
using System;
using System.Collections;
using Microsoft.BizTalk.Bam.EventObservation;

namespace GenerateTypedBamApi
{
  [Serializable]
  public class BufferedESApi
  {
    #region A collection of the activities defined
    
    public struct Activities
    {
      public const string CLM_837I = "CLM_837I";
      public const string CLM_835 = "CLM_835";
      public const string EB_270 = "EB_270";
      public const string EB_271 = "EB_271";
      public const string EB_270_Details = "EB_270_Details";
      public const string EB_271_Details = "EB_271_Details";
      public const string Availity_Realtime_Messaging = "Availity_Realtime_Messaging";
      public const string Availity_Realtime_Messaging_PayerErrors = "Availity_Realtime_Messaging_PayerErrors";
      public const string ClaimMessagingStatistics = "ClaimMessagingStatistics";
      public const string EDI_Correlation = "EDI_Correlation";
      public const string EDI_Envelope_Interchange = "EDI_Envelope_Interchange";
      public const string EDI_Envelope_Group = "EDI_Envelope_Group";
      public const string EDI_Envelope_Transaction = "EDI_Envelope_Transaction";
      public const string MessageLog = "MessageLog";
      public const string MessageContextProperties = "MessageContextProperties";
    }
    
    #endregion
  
    
    #region Helper class for the CLM_837I BAM activity
  
    public class CLM_837I
    {
      public CLM_837I(string CLM_837IID)
      {
        _CLM_837IID = CLM_837IID;
      } 

      public string ActivityID
      {
        get { return _CLM_837IID; }
      }	

      // Begin the CLM_837I BAM activity
      public void BeginCLM_837IActivity()
      {			
        // Begin the Activity using the passed identifier
        BufferedEventStream es = GetEventStream();
        es.BeginActivity(ActivityName ,_CLM_837IID);
        
      }

      // Write any data changes to the _CLM_837I activity
      // This must be called post any property changes
      public void CommitCLM_837IActivity()
      {
        // We need to provide the key/value pairs to the BAM API
        ArrayList al = new ArrayList();								
        foreach (DictionaryEntry de in _activityItemHashtable)
        {
          al.Add(de.Key);
          al.Add(de.Value);
        }
        			
        // Update the BAM Activity with all of the data
        BufferedEventStream es = GetEventStream();
        es.UpdateActivity(ActivityName,_CLM_837IID,al.ToArray() );	
              
      }

      // End the CLM_837I BAM activity, no more changes will be permitted to this activity unless continuation is used
      public void EndCLM_837IActivity()
      {
        // End this activity, no more data can be added.
        BufferedEventStream es = GetEventStream();
        es.EndActivity(ActivityName,_CLM_837IID);
      }

      // Add a reference from this activity to another activity
      public void AddReferenceToAnotherActivity(string OtherActivityName, string OtherActivityID)
      {
        // Add a reference to another activity
        BufferedEventStream es = GetEventStream();
        es.AddReference(ActivityName,_CLM_837IID,"Activity",OtherActivityName,OtherActivityID);
      }

      // Add a custom reference to this activity, this enables "data" to be attached to an activity such as a message body
      public void AddCustomReference(string referenceName, string referenceType, string referenceData, string longReferenceData)
      { 
        // Add a reference to another activity
        BufferedEventStream es = GetEventStream();
        es.AddReference(ActivityName,_CLM_837IID,referenceName,referenceType,referenceData, longReferenceData);
      }

      
      public DateTime ReceiveClaim
      {
        set { _activityItemHashtable.Add(ReceiveClaimBAMFieldName,value); }
        get { return (DateTime)_activityItemHashtable[ReceiveClaimBAMFieldName]; }
      }

      public const string ReceiveClaimBAMFieldName = "ReceiveClaim";
 
      public decimal Claim_CLM02_TotalClaimCharge
      {
        set { _activityItemHashtable.Add(Claim_CLM02_TotalClaimChargeBAMFieldName,value); }
        get { return (decimal)_activityItemHashtable[Claim_CLM02_TotalClaimChargeBAMFieldName]; }
      }

      public const string Claim_CLM02_TotalClaimChargeBAMFieldName = "Claim_CLM02_TotalClaimCharge";
 
      public string Claim_CLM01_PatientAccountNumber
      {
        set { _activityItemHashtable.Add(Claim_CLM01_PatientAccountNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[Claim_CLM01_PatientAccountNumberBAMFieldName]; }
      }

      public const string Claim_CLM01_PatientAccountNumberBAMFieldName = "Claim_CLM01_PatientAccountNumber";
 
      public string Subscriber_NM109_SubscriberPrimaryIdentifier
      {
        set { _activityItemHashtable.Add(Subscriber_NM109_SubscriberPrimaryIdentifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[Subscriber_NM109_SubscriberPrimaryIdentifierBAMFieldName]; }
      }

      public const string Subscriber_NM109_SubscriberPrimaryIdentifierBAMFieldName = "Subscriber_NM109_SubscriberPrimaryIdentifier";
 
      public string BTSMessageID
      {
        set { _activityItemHashtable.Add(BTSMessageIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSMessageIDBAMFieldName]; }
      }

      public const string BTSMessageIDBAMFieldName = "BTSMessageID";
 
      public string Payer_NM109_PayerIdentifier
      {
        set { _activityItemHashtable.Add(Payer_NM109_PayerIdentifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[Payer_NM109_PayerIdentifierBAMFieldName]; }
      }

      public const string Payer_NM109_PayerIdentifierBAMFieldName = "Payer_NM109_PayerIdentifier";
 
      public string CommunicationMethod
      {
        set { _activityItemHashtable.Add(CommunicationMethodBAMFieldName,value); }
        get { return (string)_activityItemHashtable[CommunicationMethodBAMFieldName]; }
      }

      public const string CommunicationMethodBAMFieldName = "CommunicationMethod";
 
      public string IsDependent
      {
        set { _activityItemHashtable.Add(IsDependentBAMFieldName,value); }
        get { return (string)_activityItemHashtable[IsDependentBAMFieldName]; }
      }

      public const string IsDependentBAMFieldName = "IsDependent";
 
      public string Patient_PAT01_IndividualRelationshipCode
      {
        set { _activityItemHashtable.Add(Patient_PAT01_IndividualRelationshipCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[Patient_PAT01_IndividualRelationshipCodeBAMFieldName]; }
      }

      public const string Patient_PAT01_IndividualRelationshipCodeBAMFieldName = "Patient_PAT01_IndividualRelationshipCode";
 
      public string RoutedTo
      {
        set { _activityItemHashtable.Add(RoutedToBAMFieldName,value); }
        get { return (string)_activityItemHashtable[RoutedToBAMFieldName]; }
      }

      public const string RoutedToBAMFieldName = "RoutedTo";
 
      public string BTSInterchangeID
      {
        set { _activityItemHashtable.Add(BTSInterchangeIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSInterchangeIDBAMFieldName]; }
      }

      public const string BTSInterchangeIDBAMFieldName = "BTSInterchangeID";
 
      public string Subscriber_NM104_SubscriberFirstName
      {
        set { _activityItemHashtable.Add(Subscriber_NM104_SubscriberFirstNameBAMFieldName,value); }
        get { return (string)_activityItemHashtable[Subscriber_NM104_SubscriberFirstNameBAMFieldName]; }
      }

      public const string Subscriber_NM104_SubscriberFirstNameBAMFieldName = "Subscriber_NM104_SubscriberFirstName";
 
      public string Subscriber_NM105_SubscriberLastName
      {
        set { _activityItemHashtable.Add(Subscriber_NM105_SubscriberLastNameBAMFieldName,value); }
        get { return (string)_activityItemHashtable[Subscriber_NM105_SubscriberLastNameBAMFieldName]; }
      }

      public const string Subscriber_NM105_SubscriberLastNameBAMFieldName = "Subscriber_NM105_SubscriberLastName";
 
      public const string ActivityName = "CLM_837I";
      private string _CLM_837IID = null;
      private Hashtable _activityItemHashtable = new Hashtable();
    }
  
  #endregion

    #region Helper class for the CLM_835 BAM activity
  
    public class CLM_835
    {
      public CLM_835(string CLM_835ID)
      {
        _CLM_835ID = CLM_835ID;
      } 

      public string ActivityID
      {
        get { return _CLM_835ID; }
      }	

      // Begin the CLM_835 BAM activity
      public void BeginCLM_835Activity()
      {			
        // Begin the Activity using the passed identifier
        BufferedEventStream es = GetEventStream();
        es.BeginActivity(ActivityName ,_CLM_835ID);
        
      }

      // Write any data changes to the _CLM_835 activity
      // This must be called post any property changes
      public void CommitCLM_835Activity()
      {
        // We need to provide the key/value pairs to the BAM API
        ArrayList al = new ArrayList();								
        foreach (DictionaryEntry de in _activityItemHashtable)
        {
          al.Add(de.Key);
          al.Add(de.Value);
        }
        			
        // Update the BAM Activity with all of the data
        BufferedEventStream es = GetEventStream();
        es.UpdateActivity(ActivityName,_CLM_835ID,al.ToArray() );	
              
      }

      // End the CLM_835 BAM activity, no more changes will be permitted to this activity unless continuation is used
      public void EndCLM_835Activity()
      {
        // End this activity, no more data can be added.
        BufferedEventStream es = GetEventStream();
        es.EndActivity(ActivityName,_CLM_835ID);
      }

      // Add a reference from this activity to another activity
      public void AddReferenceToAnotherActivity(string OtherActivityName, string OtherActivityID)
      {
        // Add a reference to another activity
        BufferedEventStream es = GetEventStream();
        es.AddReference(ActivityName,_CLM_835ID,"Activity",OtherActivityName,OtherActivityID);
      }

      // Add a custom reference to this activity, this enables "data" to be attached to an activity such as a message body
      public void AddCustomReference(string referenceName, string referenceType, string referenceData, string longReferenceData)
      { 
        // Add a reference to another activity
        BufferedEventStream es = GetEventStream();
        es.AddReference(ActivityName,_CLM_835ID,referenceName,referenceType,referenceData, longReferenceData);
      }

      
      public DateTime ReceiveClaimPayment
      {
        set { _activityItemHashtable.Add(ReceiveClaimPaymentBAMFieldName,value); }
        get { return (DateTime)_activityItemHashtable[ReceiveClaimPaymentBAMFieldName]; }
      }

      public const string ReceiveClaimPaymentBAMFieldName = "ReceiveClaimPayment";
 
      public string ClaimPayment_CLP01_PatientAccountNumber
      {
        set { _activityItemHashtable.Add(ClaimPayment_CLP01_PatientAccountNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ClaimPayment_CLP01_PatientAccountNumberBAMFieldName]; }
      }

      public const string ClaimPayment_CLP01_PatientAccountNumberBAMFieldName = "ClaimPayment_CLP01_PatientAccountNumber";
 
      public string Subscriber_NM109_SubscriberID
      {
        set { _activityItemHashtable.Add(Subscriber_NM109_SubscriberIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[Subscriber_NM109_SubscriberIDBAMFieldName]; }
      }

      public const string Subscriber_NM109_SubscriberIDBAMFieldName = "Subscriber_NM109_SubscriberID";
 
      public string BTSMessageID
      {
        set { _activityItemHashtable.Add(BTSMessageIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSMessageIDBAMFieldName]; }
      }

      public const string BTSMessageIDBAMFieldName = "BTSMessageID";
 
      public decimal ProviderSummary_TS309_TotalActualPaymentAmount
      {
        set { _activityItemHashtable.Add(ProviderSummary_TS309_TotalActualPaymentAmountBAMFieldName,value); }
        get { return (decimal)_activityItemHashtable[ProviderSummary_TS309_TotalActualPaymentAmountBAMFieldName]; }
      }

      public const string ProviderSummary_TS309_TotalActualPaymentAmountBAMFieldName = "ProviderSummary_TS309_TotalActualPaymentAmount";
 
      public string Payer_NM104_PayerIdentifier
      {
        set { _activityItemHashtable.Add(Payer_NM104_PayerIdentifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[Payer_NM104_PayerIdentifierBAMFieldName]; }
      }

      public const string Payer_NM104_PayerIdentifierBAMFieldName = "Payer_NM104_PayerIdentifier";
 
      public decimal ProviderSummary_TS306_TotalCoveredChargeAmount
      {
        set { _activityItemHashtable.Add(ProviderSummary_TS306_TotalCoveredChargeAmountBAMFieldName,value); }
        get { return (decimal)_activityItemHashtable[ProviderSummary_TS306_TotalCoveredChargeAmountBAMFieldName]; }
      }

      public const string ProviderSummary_TS306_TotalCoveredChargeAmountBAMFieldName = "ProviderSummary_TS306_TotalCoveredChargeAmount";
 
      public decimal ProviderSummary_TS307_TotalNonCoveredChargeAmount
      {
        set { _activityItemHashtable.Add(ProviderSummary_TS307_TotalNonCoveredChargeAmountBAMFieldName,value); }
        get { return (decimal)_activityItemHashtable[ProviderSummary_TS307_TotalNonCoveredChargeAmountBAMFieldName]; }
      }

      public const string ProviderSummary_TS307_TotalNonCoveredChargeAmountBAMFieldName = "ProviderSummary_TS307_TotalNonCoveredChargeAmount";
 
      public decimal ProviderSummary_TS308_TotalDeniedChargeAmount
      {
        set { _activityItemHashtable.Add(ProviderSummary_TS308_TotalDeniedChargeAmountBAMFieldName,value); }
        get { return (decimal)_activityItemHashtable[ProviderSummary_TS308_TotalDeniedChargeAmountBAMFieldName]; }
      }

      public const string ProviderSummary_TS308_TotalDeniedChargeAmountBAMFieldName = "ProviderSummary_TS308_TotalDeniedChargeAmount";
 
      public decimal ProviderSummary_TS305_TotalClaimChargeAmount
      {
        set { _activityItemHashtable.Add(ProviderSummary_TS305_TotalClaimChargeAmountBAMFieldName,value); }
        get { return (decimal)_activityItemHashtable[ProviderSummary_TS305_TotalClaimChargeAmountBAMFieldName]; }
      }

      public const string ProviderSummary_TS305_TotalClaimChargeAmountBAMFieldName = "ProviderSummary_TS305_TotalClaimChargeAmount";
 
      public string BTSInterchangeID
      {
        set { _activityItemHashtable.Add(BTSInterchangeIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSInterchangeIDBAMFieldName]; }
      }

      public const string BTSInterchangeIDBAMFieldName = "BTSInterchangeID";
 
      public string IsDependent
      {
        set { _activityItemHashtable.Add(IsDependentBAMFieldName,value); }
        get { return (string)_activityItemHashtable[IsDependentBAMFieldName]; }
      }

      public const string IsDependentBAMFieldName = "IsDependent";
 
      public string Patient_NM109_PatientIdentifier
      {
        set { _activityItemHashtable.Add(Patient_NM109_PatientIdentifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[Patient_NM109_PatientIdentifierBAMFieldName]; }
      }

      public const string Patient_NM109_PatientIdentifierBAMFieldName = "Patient_NM109_PatientIdentifier";
 
      public string ClaimPayment_CLP02_ClaimStatusCode
      {
        set { _activityItemHashtable.Add(ClaimPayment_CLP02_ClaimStatusCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ClaimPayment_CLP02_ClaimStatusCodeBAMFieldName]; }
      }

      public const string ClaimPayment_CLP02_ClaimStatusCodeBAMFieldName = "ClaimPayment_CLP02_ClaimStatusCode";
 
      public decimal ClaimPayment_CLP03_TotalClaimChargeAmount
      {
        set { _activityItemHashtable.Add(ClaimPayment_CLP03_TotalClaimChargeAmountBAMFieldName,value); }
        get { return (decimal)_activityItemHashtable[ClaimPayment_CLP03_TotalClaimChargeAmountBAMFieldName]; }
      }

      public const string ClaimPayment_CLP03_TotalClaimChargeAmountBAMFieldName = "ClaimPayment_CLP03_TotalClaimChargeAmount";
 
      public decimal ClaimPayment_CLP04_ClaimPaymentAmount
      {
        set { _activityItemHashtable.Add(ClaimPayment_CLP04_ClaimPaymentAmountBAMFieldName,value); }
        get { return (decimal)_activityItemHashtable[ClaimPayment_CLP04_ClaimPaymentAmountBAMFieldName]; }
      }

      public const string ClaimPayment_CLP04_ClaimPaymentAmountBAMFieldName = "ClaimPayment_CLP04_ClaimPaymentAmount";
 
      public decimal ClaimPayment_CLP05_PatientResponsibilityAmount
      {
        set { _activityItemHashtable.Add(ClaimPayment_CLP05_PatientResponsibilityAmountBAMFieldName,value); }
        get { return (decimal)_activityItemHashtable[ClaimPayment_CLP05_PatientResponsibilityAmountBAMFieldName]; }
      }

      public const string ClaimPayment_CLP05_PatientResponsibilityAmountBAMFieldName = "ClaimPayment_CLP05_PatientResponsibilityAmount";
 
      public string ClaimPayment_CLP06_ClaimFilingIDCode
      {
        set { _activityItemHashtable.Add(ClaimPayment_CLP06_ClaimFilingIDCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ClaimPayment_CLP06_ClaimFilingIDCodeBAMFieldName]; }
      }

      public const string ClaimPayment_CLP06_ClaimFilingIDCodeBAMFieldName = "ClaimPayment_CLP06_ClaimFilingIDCode";
 
      public string ClaimPayment_CLP07_PayerClaimControlNumber
      {
        set { _activityItemHashtable.Add(ClaimPayment_CLP07_PayerClaimControlNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ClaimPayment_CLP07_PayerClaimControlNumberBAMFieldName]; }
      }

      public const string ClaimPayment_CLP07_PayerClaimControlNumberBAMFieldName = "ClaimPayment_CLP07_PayerClaimControlNumber";
 
      public string Payer_NM102_PayerName
      {
        set { _activityItemHashtable.Add(Payer_NM102_PayerNameBAMFieldName,value); }
        get { return (string)_activityItemHashtable[Payer_NM102_PayerNameBAMFieldName]; }
      }

      public const string Payer_NM102_PayerNameBAMFieldName = "Payer_NM102_PayerName";
 
      public string Payer_N401_AddressCity
      {
        set { _activityItemHashtable.Add(Payer_N401_AddressCityBAMFieldName,value); }
        get { return (string)_activityItemHashtable[Payer_N401_AddressCityBAMFieldName]; }
      }

      public const string Payer_N401_AddressCityBAMFieldName = "Payer_N401_AddressCity";
 
      public string Payer_N402_AddressState
      {
        set { _activityItemHashtable.Add(Payer_N402_AddressStateBAMFieldName,value); }
        get { return (string)_activityItemHashtable[Payer_N402_AddressStateBAMFieldName]; }
      }

      public const string Payer_N402_AddressStateBAMFieldName = "Payer_N402_AddressState";
 
      public string Payer_Per02_ContactName
      {
        set { _activityItemHashtable.Add(Payer_Per02_ContactNameBAMFieldName,value); }
        get { return (string)_activityItemHashtable[Payer_Per02_ContactNameBAMFieldName]; }
      }

      public const string Payer_Per02_ContactNameBAMFieldName = "Payer_Per02_ContactName";
 
      public string Payer_Per04_CommunicationNumber
      {
        set { _activityItemHashtable.Add(Payer_Per04_CommunicationNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[Payer_Per04_CommunicationNumberBAMFieldName]; }
      }

      public const string Payer_Per04_CommunicationNumberBAMFieldName = "Payer_Per04_CommunicationNumber";
 
      public string ClaimPayment_CLP08_FacilityTypeCode
      {
        set { _activityItemHashtable.Add(ClaimPayment_CLP08_FacilityTypeCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ClaimPayment_CLP08_FacilityTypeCodeBAMFieldName]; }
      }

      public const string ClaimPayment_CLP08_FacilityTypeCodeBAMFieldName = "ClaimPayment_CLP08_FacilityTypeCode";
 
      public string ClaimPayment_CLP11_DRGCode
      {
        set { _activityItemHashtable.Add(ClaimPayment_CLP11_DRGCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ClaimPayment_CLP11_DRGCodeBAMFieldName]; }
      }

      public const string ClaimPayment_CLP11_DRGCodeBAMFieldName = "ClaimPayment_CLP11_DRGCode";
 
      public string ClaimPayment_CLP12_DRGWeight
      {
        set { _activityItemHashtable.Add(ClaimPayment_CLP12_DRGWeightBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ClaimPayment_CLP12_DRGWeightBAMFieldName]; }
      }

      public const string ClaimPayment_CLP12_DRGWeightBAMFieldName = "ClaimPayment_CLP12_DRGWeight";
 
      public string ClaimPayment_CLP13_DischargeFraction
      {
        set { _activityItemHashtable.Add(ClaimPayment_CLP13_DischargeFractionBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ClaimPayment_CLP13_DischargeFractionBAMFieldName]; }
      }

      public const string ClaimPayment_CLP13_DischargeFractionBAMFieldName = "ClaimPayment_CLP13_DischargeFraction";
 
      public const string ActivityName = "CLM_835";
      private string _CLM_835ID = null;
      private Hashtable _activityItemHashtable = new Hashtable();
    }
  
  #endregion

    #region Helper class for the EB_270 BAM activity
  
    public class EB_270
    {
      public EB_270(string EB_270ID)
      {
        _EB_270ID = EB_270ID;
      } 

      public string ActivityID
      {
        get { return _EB_270ID; }
      }	

      // Begin the EB_270 BAM activity
      public void BeginEB_270Activity()
      {			
        // Begin the Activity using the passed identifier
        BufferedEventStream es = GetEventStream();
        es.BeginActivity(ActivityName ,_EB_270ID);
        
      }

      // Write any data changes to the _EB_270 activity
      // This must be called post any property changes
      public void CommitEB_270Activity()
      {
        // We need to provide the key/value pairs to the BAM API
        ArrayList al = new ArrayList();								
        foreach (DictionaryEntry de in _activityItemHashtable)
        {
          al.Add(de.Key);
          al.Add(de.Value);
        }
        			
        // Update the BAM Activity with all of the data
        BufferedEventStream es = GetEventStream();
        es.UpdateActivity(ActivityName,_EB_270ID,al.ToArray() );	
              
      }

      // End the EB_270 BAM activity, no more changes will be permitted to this activity unless continuation is used
      public void EndEB_270Activity()
      {
        // End this activity, no more data can be added.
        BufferedEventStream es = GetEventStream();
        es.EndActivity(ActivityName,_EB_270ID);
      }

      // Add a reference from this activity to another activity
      public void AddReferenceToAnotherActivity(string OtherActivityName, string OtherActivityID)
      {
        // Add a reference to another activity
        BufferedEventStream es = GetEventStream();
        es.AddReference(ActivityName,_EB_270ID,"Activity",OtherActivityName,OtherActivityID);
      }

      // Add a custom reference to this activity, this enables "data" to be attached to an activity such as a message body
      public void AddCustomReference(string referenceName, string referenceType, string referenceData, string longReferenceData)
      { 
        // Add a reference to another activity
        BufferedEventStream es = GetEventStream();
        es.AddReference(ActivityName,_EB_270ID,referenceName,referenceType,referenceData, longReferenceData);
      }

      
      public string InfoSource_NM101_SourceEntityIdentifierCode
      {
        set { _activityItemHashtable.Add(InfoSource_NM101_SourceEntityIdentifierCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[InfoSource_NM101_SourceEntityIdentifierCodeBAMFieldName]; }
      }

      public const string InfoSource_NM101_SourceEntityIdentifierCodeBAMFieldName = "InfoSource_NM101_SourceEntityIdentifierCode";
 
      public string InfoSource_NM103_SourceLastOrOrganizationName
      {
        set { _activityItemHashtable.Add(InfoSource_NM103_SourceLastOrOrganizationNameBAMFieldName,value); }
        get { return (string)_activityItemHashtable[InfoSource_NM103_SourceLastOrOrganizationNameBAMFieldName]; }
      }

      public const string InfoSource_NM103_SourceLastOrOrganizationNameBAMFieldName = "InfoSource_NM103_SourceLastOrOrganizationName";
 
      public string InfoSource_NM109_SourcePrimaryIdentifier
      {
        set { _activityItemHashtable.Add(InfoSource_NM109_SourcePrimaryIdentifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[InfoSource_NM109_SourcePrimaryIdentifierBAMFieldName]; }
      }

      public const string InfoSource_NM109_SourcePrimaryIdentifierBAMFieldName = "InfoSource_NM109_SourcePrimaryIdentifier";
 
      public string InfoReceiver_NM101_ReceiverEntityIdentifierCode
      {
        set { _activityItemHashtable.Add(InfoReceiver_NM101_ReceiverEntityIdentifierCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[InfoReceiver_NM101_ReceiverEntityIdentifierCodeBAMFieldName]; }
      }

      public const string InfoReceiver_NM101_ReceiverEntityIdentifierCodeBAMFieldName = "InfoReceiver_NM101_ReceiverEntityIdentifierCode";
 
      public string InfoReceiver_NM102_ReceiverEntityTypeQualifier
      {
        set { _activityItemHashtable.Add(InfoReceiver_NM102_ReceiverEntityTypeQualifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[InfoReceiver_NM102_ReceiverEntityTypeQualifierBAMFieldName]; }
      }

      public const string InfoReceiver_NM102_ReceiverEntityTypeQualifierBAMFieldName = "InfoReceiver_NM102_ReceiverEntityTypeQualifier";
 
      public string InfoReceiver_NM103_ReceiverLastOrOrganizationName
      {
        set { _activityItemHashtable.Add(InfoReceiver_NM103_ReceiverLastOrOrganizationNameBAMFieldName,value); }
        get { return (string)_activityItemHashtable[InfoReceiver_NM103_ReceiverLastOrOrganizationNameBAMFieldName]; }
      }

      public const string InfoReceiver_NM103_ReceiverLastOrOrganizationNameBAMFieldName = "InfoReceiver_NM103_ReceiverLastOrOrganizationName";
 
      public string InfoReceiver_NM109_ReceiverIDNumber
      {
        set { _activityItemHashtable.Add(InfoReceiver_NM109_ReceiverIDNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[InfoReceiver_NM109_ReceiverIDNumberBAMFieldName]; }
      }

      public const string InfoReceiver_NM109_ReceiverIDNumberBAMFieldName = "InfoReceiver_NM109_ReceiverIDNumber";
 
      public string InfoReceiver_REF01_ReceiverRefIDQualifier
      {
        set { _activityItemHashtable.Add(InfoReceiver_REF01_ReceiverRefIDQualifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[InfoReceiver_REF01_ReceiverRefIDQualifierBAMFieldName]; }
      }

      public const string InfoReceiver_REF01_ReceiverRefIDQualifierBAMFieldName = "InfoReceiver_REF01_ReceiverRefIDQualifier";
 
      public string InfoReceiver_REF02_ReceiverAdditionalIdentifier
      {
        set { _activityItemHashtable.Add(InfoReceiver_REF02_ReceiverAdditionalIdentifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[InfoReceiver_REF02_ReceiverAdditionalIdentifierBAMFieldName]; }
      }

      public const string InfoReceiver_REF02_ReceiverAdditionalIdentifierBAMFieldName = "InfoReceiver_REF02_ReceiverAdditionalIdentifier";
 
      public string InfoReceiver_REF03_LicenseNumberStateCode
      {
        set { _activityItemHashtable.Add(InfoReceiver_REF03_LicenseNumberStateCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[InfoReceiver_REF03_LicenseNumberStateCodeBAMFieldName]; }
      }

      public const string InfoReceiver_REF03_LicenseNumberStateCodeBAMFieldName = "InfoReceiver_REF03_LicenseNumberStateCode";
 
      public string Subscriber_TRN02_TraceNumber
      {
        set { _activityItemHashtable.Add(Subscriber_TRN02_TraceNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[Subscriber_TRN02_TraceNumberBAMFieldName]; }
      }

      public const string Subscriber_TRN02_TraceNumberBAMFieldName = "Subscriber_TRN02_TraceNumber";
 
      public string Subscriber_TRN03_TraceAssigningEntityID
      {
        set { _activityItemHashtable.Add(Subscriber_TRN03_TraceAssigningEntityIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[Subscriber_TRN03_TraceAssigningEntityIDBAMFieldName]; }
      }

      public const string Subscriber_TRN03_TraceAssigningEntityIDBAMFieldName = "Subscriber_TRN03_TraceAssigningEntityID";
 
      public string Subscriber_TRN04_TraceAssigningEntityAdditionalID
      {
        set { _activityItemHashtable.Add(Subscriber_TRN04_TraceAssigningEntityAdditionalIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[Subscriber_TRN04_TraceAssigningEntityAdditionalIDBAMFieldName]; }
      }

      public const string Subscriber_TRN04_TraceAssigningEntityAdditionalIDBAMFieldName = "Subscriber_TRN04_TraceAssigningEntityAdditionalID";
 
      public string Subscriber_NM103_SubscriberDependentLastName
      {
        set { _activityItemHashtable.Add(Subscriber_NM103_SubscriberDependentLastNameBAMFieldName,value); }
        get { return (string)_activityItemHashtable[Subscriber_NM103_SubscriberDependentLastNameBAMFieldName]; }
      }

      public const string Subscriber_NM103_SubscriberDependentLastNameBAMFieldName = "Subscriber_NM103_SubscriberDependentLastName";
 
      public string Subscriber_NM104_SubscriberDependentFirstName
      {
        set { _activityItemHashtable.Add(Subscriber_NM104_SubscriberDependentFirstNameBAMFieldName,value); }
        get { return (string)_activityItemHashtable[Subscriber_NM104_SubscriberDependentFirstNameBAMFieldName]; }
      }

      public const string Subscriber_NM104_SubscriberDependentFirstNameBAMFieldName = "Subscriber_NM104_SubscriberDependentFirstName";
 
      public string Subscriber_NM109_SubscriberPrimaryIdentifier
      {
        set { _activityItemHashtable.Add(Subscriber_NM109_SubscriberPrimaryIdentifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[Subscriber_NM109_SubscriberPrimaryIdentifierBAMFieldName]; }
      }

      public const string Subscriber_NM109_SubscriberPrimaryIdentifierBAMFieldName = "Subscriber_NM109_SubscriberPrimaryIdentifier";
 
      public string IsDependent
      {
        set { _activityItemHashtable.Add(IsDependentBAMFieldName,value); }
        get { return (string)_activityItemHashtable[IsDependentBAMFieldName]; }
      }

      public const string IsDependentBAMFieldName = "IsDependent";
 
      public DateTime SendRequest
      {
        set { _activityItemHashtable.Add(SendRequestBAMFieldName,value); }
        get { return (DateTime)_activityItemHashtable[SendRequestBAMFieldName]; }
      }

      public const string SendRequestBAMFieldName = "SendRequest";
 
      public string Subscriber_PRV01_ProviderCode
      {
        set { _activityItemHashtable.Add(Subscriber_PRV01_ProviderCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[Subscriber_PRV01_ProviderCodeBAMFieldName]; }
      }

      public const string Subscriber_PRV01_ProviderCodeBAMFieldName = "Subscriber_PRV01_ProviderCode";
 
      public string Subscriber_PRV03_ProviderIdentifier
      {
        set { _activityItemHashtable.Add(Subscriber_PRV03_ProviderIdentifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[Subscriber_PRV03_ProviderIdentifierBAMFieldName]; }
      }

      public const string Subscriber_PRV03_ProviderIdentifierBAMFieldName = "Subscriber_PRV03_ProviderIdentifier";
 
      public string BHT03_SubmitterTransactionIdentifier
      {
        set { _activityItemHashtable.Add(BHT03_SubmitterTransactionIdentifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BHT03_SubmitterTransactionIdentifierBAMFieldName]; }
      }

      public const string BHT03_SubmitterTransactionIdentifierBAMFieldName = "BHT03_SubmitterTransactionIdentifier";
 
      public string CommunicationMethod
      {
        set { _activityItemHashtable.Add(CommunicationMethodBAMFieldName,value); }
        get { return (string)_activityItemHashtable[CommunicationMethodBAMFieldName]; }
      }

      public const string CommunicationMethodBAMFieldName = "CommunicationMethod";
 
      public string RoutedTo
      {
        set { _activityItemHashtable.Add(RoutedToBAMFieldName,value); }
        get { return (string)_activityItemHashtable[RoutedToBAMFieldName]; }
      }

      public const string RoutedToBAMFieldName = "RoutedTo";
 
      public string BTSMessageID
      {
        set { _activityItemHashtable.Add(BTSMessageIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSMessageIDBAMFieldName]; }
      }

      public const string BTSMessageIDBAMFieldName = "BTSMessageID";
 
      public string BTSInterchangeID
      {
        set { _activityItemHashtable.Add(BTSInterchangeIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSInterchangeIDBAMFieldName]; }
      }

      public const string BTSInterchangeIDBAMFieldName = "BTSInterchangeID";
 
      public const string ActivityName = "EB_270";
      private string _EB_270ID = null;
      private Hashtable _activityItemHashtable = new Hashtable();
    }
  
  #endregion

    #region Helper class for the EB_271 BAM activity
  
    public class EB_271
    {
      public EB_271(string EB_271ID)
      {
        _EB_271ID = EB_271ID;
      } 

      public string ActivityID
      {
        get { return _EB_271ID; }
      }	

      // Begin the EB_271 BAM activity
      public void BeginEB_271Activity()
      {			
        // Begin the Activity using the passed identifier
        BufferedEventStream es = GetEventStream();
        es.BeginActivity(ActivityName ,_EB_271ID);
        
      }

      // Write any data changes to the _EB_271 activity
      // This must be called post any property changes
      public void CommitEB_271Activity()
      {
        // We need to provide the key/value pairs to the BAM API
        ArrayList al = new ArrayList();								
        foreach (DictionaryEntry de in _activityItemHashtable)
        {
          al.Add(de.Key);
          al.Add(de.Value);
        }
        			
        // Update the BAM Activity with all of the data
        BufferedEventStream es = GetEventStream();
        es.UpdateActivity(ActivityName,_EB_271ID,al.ToArray() );	
              
      }

      // End the EB_271 BAM activity, no more changes will be permitted to this activity unless continuation is used
      public void EndEB_271Activity()
      {
        // End this activity, no more data can be added.
        BufferedEventStream es = GetEventStream();
        es.EndActivity(ActivityName,_EB_271ID);
      }

      // Add a reference from this activity to another activity
      public void AddReferenceToAnotherActivity(string OtherActivityName, string OtherActivityID)
      {
        // Add a reference to another activity
        BufferedEventStream es = GetEventStream();
        es.AddReference(ActivityName,_EB_271ID,"Activity",OtherActivityName,OtherActivityID);
      }

      // Add a custom reference to this activity, this enables "data" to be attached to an activity such as a message body
      public void AddCustomReference(string referenceName, string referenceType, string referenceData, string longReferenceData)
      { 
        // Add a reference to another activity
        BufferedEventStream es = GetEventStream();
        es.AddReference(ActivityName,_EB_271ID,referenceName,referenceType,referenceData, longReferenceData);
      }

      
      public string InfoSource_NM109_SourcePrimaryID
      {
        set { _activityItemHashtable.Add(InfoSource_NM109_SourcePrimaryIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[InfoSource_NM109_SourcePrimaryIDBAMFieldName]; }
      }

      public const string InfoSource_NM109_SourcePrimaryIDBAMFieldName = "InfoSource_NM109_SourcePrimaryID";
 
      public string InfoSource_REF03_PlanName
      {
        set { _activityItemHashtable.Add(InfoSource_REF03_PlanNameBAMFieldName,value); }
        get { return (string)_activityItemHashtable[InfoSource_REF03_PlanNameBAMFieldName]; }
      }

      public const string InfoSource_REF03_PlanNameBAMFieldName = "InfoSource_REF03_PlanName";
 
      public string Subscriber_TRN01_TraceTypeCode
      {
        set { _activityItemHashtable.Add(Subscriber_TRN01_TraceTypeCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[Subscriber_TRN01_TraceTypeCodeBAMFieldName]; }
      }

      public const string Subscriber_TRN01_TraceTypeCodeBAMFieldName = "Subscriber_TRN01_TraceTypeCode";
 
      public string Subscriber_TRN02_TraceNumber
      {
        set { _activityItemHashtable.Add(Subscriber_TRN02_TraceNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[Subscriber_TRN02_TraceNumberBAMFieldName]; }
      }

      public const string Subscriber_TRN02_TraceNumberBAMFieldName = "Subscriber_TRN02_TraceNumber";
 
      public string Subscriber_TRN03_TraceAssigningEntityID
      {
        set { _activityItemHashtable.Add(Subscriber_TRN03_TraceAssigningEntityIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[Subscriber_TRN03_TraceAssigningEntityIDBAMFieldName]; }
      }

      public const string Subscriber_TRN03_TraceAssigningEntityIDBAMFieldName = "Subscriber_TRN03_TraceAssigningEntityID";
 
      public string Subscriber_TRN04_TraceAssigningEntityAdditionalID
      {
        set { _activityItemHashtable.Add(Subscriber_TRN04_TraceAssigningEntityAdditionalIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[Subscriber_TRN04_TraceAssigningEntityAdditionalIDBAMFieldName]; }
      }

      public const string Subscriber_TRN04_TraceAssigningEntityAdditionalIDBAMFieldName = "Subscriber_TRN04_TraceAssigningEntityAdditionalID";
 
      public string Subscriber_NM109_SubscriberPrimaryIdentifier
      {
        set { _activityItemHashtable.Add(Subscriber_NM109_SubscriberPrimaryIdentifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[Subscriber_NM109_SubscriberPrimaryIdentifierBAMFieldName]; }
      }

      public const string Subscriber_NM109_SubscriberPrimaryIdentifierBAMFieldName = "Subscriber_NM109_SubscriberPrimaryIdentifier";
 
      public string IsDependent
      {
        set { _activityItemHashtable.Add(IsDependentBAMFieldName,value); }
        get { return (string)_activityItemHashtable[IsDependentBAMFieldName]; }
      }

      public const string IsDependentBAMFieldName = "IsDependent";
 
      public DateTime ReceiveResponse
      {
        set { _activityItemHashtable.Add(ReceiveResponseBAMFieldName,value); }
        get { return (DateTime)_activityItemHashtable[ReceiveResponseBAMFieldName]; }
      }

      public const string ReceiveResponseBAMFieldName = "ReceiveResponse";
 
      public string Subscriber_REF02_SubscriberSupplementalID
      {
        set { _activityItemHashtable.Add(Subscriber_REF02_SubscriberSupplementalIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[Subscriber_REF02_SubscriberSupplementalIDBAMFieldName]; }
      }

      public const string Subscriber_REF02_SubscriberSupplementalIDBAMFieldName = "Subscriber_REF02_SubscriberSupplementalID";
 
      public string Subscriber_REF03_PlanSponsorName
      {
        set { _activityItemHashtable.Add(Subscriber_REF03_PlanSponsorNameBAMFieldName,value); }
        get { return (string)_activityItemHashtable[Subscriber_REF03_PlanSponsorNameBAMFieldName]; }
      }

      public const string Subscriber_REF03_PlanSponsorNameBAMFieldName = "Subscriber_REF03_PlanSponsorName";
 
      public string Subscriber_AAA01_ValidRequestIndicator
      {
        set { _activityItemHashtable.Add(Subscriber_AAA01_ValidRequestIndicatorBAMFieldName,value); }
        get { return (string)_activityItemHashtable[Subscriber_AAA01_ValidRequestIndicatorBAMFieldName]; }
      }

      public const string Subscriber_AAA01_ValidRequestIndicatorBAMFieldName = "Subscriber_AAA01_ValidRequestIndicator";
 
      public string Subscriber_AAA03_RejectReasonCode
      {
        set { _activityItemHashtable.Add(Subscriber_AAA03_RejectReasonCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[Subscriber_AAA03_RejectReasonCodeBAMFieldName]; }
      }

      public const string Subscriber_AAA03_RejectReasonCodeBAMFieldName = "Subscriber_AAA03_RejectReasonCode";
 
      public string Subscriber_AAA04_FollowupActionCode
      {
        set { _activityItemHashtable.Add(Subscriber_AAA04_FollowupActionCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[Subscriber_AAA04_FollowupActionCodeBAMFieldName]; }
      }

      public const string Subscriber_AAA04_FollowupActionCodeBAMFieldName = "Subscriber_AAA04_FollowupActionCode";
 
      public string BHT03_SubmitterTransactionIdentifier
      {
        set { _activityItemHashtable.Add(BHT03_SubmitterTransactionIdentifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BHT03_SubmitterTransactionIdentifierBAMFieldName]; }
      }

      public const string BHT03_SubmitterTransactionIdentifierBAMFieldName = "BHT03_SubmitterTransactionIdentifier";
 
      public string BTSMessageID
      {
        set { _activityItemHashtable.Add(BTSMessageIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSMessageIDBAMFieldName]; }
      }

      public const string BTSMessageIDBAMFieldName = "BTSMessageID";
 
      public string BTSInterchangeID
      {
        set { _activityItemHashtable.Add(BTSInterchangeIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSInterchangeIDBAMFieldName]; }
      }

      public const string BTSInterchangeIDBAMFieldName = "BTSInterchangeID";
 
      public const string ActivityName = "EB_271";
      private string _EB_271ID = null;
      private Hashtable _activityItemHashtable = new Hashtable();
    }
  
  #endregion

    #region Helper class for the EB_270_Details BAM activity
  
    public class EB_270_Details
    {
      public EB_270_Details(string EB_270_DetailsID)
      {
        _EB_270_DetailsID = EB_270_DetailsID;
      } 

      public string ActivityID
      {
        get { return _EB_270_DetailsID; }
      }	

      // Begin the EB_270_Details BAM activity
      public void BeginEB_270_DetailsActivity()
      {			
        // Begin the Activity using the passed identifier
        BufferedEventStream es = GetEventStream();
        es.BeginActivity(ActivityName ,_EB_270_DetailsID);
        
      }

      // Write any data changes to the _EB_270_Details activity
      // This must be called post any property changes
      public void CommitEB_270_DetailsActivity()
      {
        // We need to provide the key/value pairs to the BAM API
        ArrayList al = new ArrayList();								
        foreach (DictionaryEntry de in _activityItemHashtable)
        {
          al.Add(de.Key);
          al.Add(de.Value);
        }
        			
        // Update the BAM Activity with all of the data
        BufferedEventStream es = GetEventStream();
        es.UpdateActivity(ActivityName,_EB_270_DetailsID,al.ToArray() );	
              
      }

      // End the EB_270_Details BAM activity, no more changes will be permitted to this activity unless continuation is used
      public void EndEB_270_DetailsActivity()
      {
        // End this activity, no more data can be added.
        BufferedEventStream es = GetEventStream();
        es.EndActivity(ActivityName,_EB_270_DetailsID);
      }

      // Add a reference from this activity to another activity
      public void AddReferenceToAnotherActivity(string OtherActivityName, string OtherActivityID)
      {
        // Add a reference to another activity
        BufferedEventStream es = GetEventStream();
        es.AddReference(ActivityName,_EB_270_DetailsID,"Activity",OtherActivityName,OtherActivityID);
      }

      // Add a custom reference to this activity, this enables "data" to be attached to an activity such as a message body
      public void AddCustomReference(string referenceName, string referenceType, string referenceData, string longReferenceData)
      { 
        // Add a reference to another activity
        BufferedEventStream es = GetEventStream();
        es.AddReference(ActivityName,_EB_270_DetailsID,referenceName,referenceType,referenceData, longReferenceData);
      }

      
      public string Subscriber_TRN03_TraceNumber
      {
        set { _activityItemHashtable.Add(Subscriber_TRN03_TraceNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[Subscriber_TRN03_TraceNumberBAMFieldName]; }
      }

      public const string Subscriber_TRN03_TraceNumberBAMFieldName = "Subscriber_TRN03_TraceNumber";
 
      public string BenefitInquiry_EQ01_ServiceTypeCode
      {
        set { _activityItemHashtable.Add(BenefitInquiry_EQ01_ServiceTypeCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BenefitInquiry_EQ01_ServiceTypeCodeBAMFieldName]; }
      }

      public const string BenefitInquiry_EQ01_ServiceTypeCodeBAMFieldName = "BenefitInquiry_EQ01_ServiceTypeCode";
 
      public string BenefitInquiry_EQ2_ProductOrServiceIDQualifier
      {
        set { _activityItemHashtable.Add(BenefitInquiry_EQ2_ProductOrServiceIDQualifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BenefitInquiry_EQ2_ProductOrServiceIDQualifierBAMFieldName]; }
      }

      public const string BenefitInquiry_EQ2_ProductOrServiceIDQualifierBAMFieldName = "BenefitInquiry_EQ2_ProductOrServiceIDQualifier";
 
      public string BenefitInquiry_EQ2_ProcedureCode
      {
        set { _activityItemHashtable.Add(BenefitInquiry_EQ2_ProcedureCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BenefitInquiry_EQ2_ProcedureCodeBAMFieldName]; }
      }

      public const string BenefitInquiry_EQ2_ProcedureCodeBAMFieldName = "BenefitInquiry_EQ2_ProcedureCode";
 
      public string BenefitInquiry_EQ2_ProcedureModifier1
      {
        set { _activityItemHashtable.Add(BenefitInquiry_EQ2_ProcedureModifier1BAMFieldName,value); }
        get { return (string)_activityItemHashtable[BenefitInquiry_EQ2_ProcedureModifier1BAMFieldName]; }
      }

      public const string BenefitInquiry_EQ2_ProcedureModifier1BAMFieldName = "BenefitInquiry_EQ2_ProcedureModifier1";
 
      public string BenefitInquiry_EQ2_ProcedureModifier2
      {
        set { _activityItemHashtable.Add(BenefitInquiry_EQ2_ProcedureModifier2BAMFieldName,value); }
        get { return (string)_activityItemHashtable[BenefitInquiry_EQ2_ProcedureModifier2BAMFieldName]; }
      }

      public const string BenefitInquiry_EQ2_ProcedureModifier2BAMFieldName = "BenefitInquiry_EQ2_ProcedureModifier2";
 
      public string BenefitInquiry_EQ2_ProcedureModifier3
      {
        set { _activityItemHashtable.Add(BenefitInquiry_EQ2_ProcedureModifier3BAMFieldName,value); }
        get { return (string)_activityItemHashtable[BenefitInquiry_EQ2_ProcedureModifier3BAMFieldName]; }
      }

      public const string BenefitInquiry_EQ2_ProcedureModifier3BAMFieldName = "BenefitInquiry_EQ2_ProcedureModifier3";
 
      public string BenefitInquiry_EQ2_ProcedureModifier4
      {
        set { _activityItemHashtable.Add(BenefitInquiry_EQ2_ProcedureModifier4BAMFieldName,value); }
        get { return (string)_activityItemHashtable[BenefitInquiry_EQ2_ProcedureModifier4BAMFieldName]; }
      }

      public const string BenefitInquiry_EQ2_ProcedureModifier4BAMFieldName = "BenefitInquiry_EQ2_ProcedureModifier4";
 
      public string BenefitInquiry_EQ3_BenefitCoverageLevelCode
      {
        set { _activityItemHashtable.Add(BenefitInquiry_EQ3_BenefitCoverageLevelCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BenefitInquiry_EQ3_BenefitCoverageLevelCodeBAMFieldName]; }
      }

      public const string BenefitInquiry_EQ3_BenefitCoverageLevelCodeBAMFieldName = "BenefitInquiry_EQ3_BenefitCoverageLevelCode";
 
      public string BenefitInquiry_EQ4_InsuranceTypeCode
      {
        set { _activityItemHashtable.Add(BenefitInquiry_EQ4_InsuranceTypeCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BenefitInquiry_EQ4_InsuranceTypeCodeBAMFieldName]; }
      }

      public const string BenefitInquiry_EQ4_InsuranceTypeCodeBAMFieldName = "BenefitInquiry_EQ4_InsuranceTypeCode";
 
      public string SubscriberSpend_AMT01_AmountQualifierCode
      {
        set { _activityItemHashtable.Add(SubscriberSpend_AMT01_AmountQualifierCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[SubscriberSpend_AMT01_AmountQualifierCodeBAMFieldName]; }
      }

      public const string SubscriberSpend_AMT01_AmountQualifierCodeBAMFieldName = "SubscriberSpend_AMT01_AmountQualifierCode";
 
      public decimal SubscriberSpend_AMT02_SpendDownAmount
      {
        set { _activityItemHashtable.Add(SubscriberSpend_AMT02_SpendDownAmountBAMFieldName,value); }
        get { return (decimal)_activityItemHashtable[SubscriberSpend_AMT02_SpendDownAmountBAMFieldName]; }
      }

      public const string SubscriberSpend_AMT02_SpendDownAmountBAMFieldName = "SubscriberSpend_AMT02_SpendDownAmount";
 
      public string BenefitInquiryAdd_III01_CodeListQualifierCode
      {
        set { _activityItemHashtable.Add(BenefitInquiryAdd_III01_CodeListQualifierCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BenefitInquiryAdd_III01_CodeListQualifierCodeBAMFieldName]; }
      }

      public const string BenefitInquiryAdd_III01_CodeListQualifierCodeBAMFieldName = "BenefitInquiryAdd_III01_CodeListQualifierCode";
 
      public string BenefitInquiryAdd_III02_IndustryCode
      {
        set { _activityItemHashtable.Add(BenefitInquiryAdd_III02_IndustryCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BenefitInquiryAdd_III02_IndustryCodeBAMFieldName]; }
      }

      public const string BenefitInquiryAdd_III02_IndustryCodeBAMFieldName = "BenefitInquiryAdd_III02_IndustryCode";
 
      public string SubscriberAddInfo_REF01_ReferenceIDQualifier
      {
        set { _activityItemHashtable.Add(SubscriberAddInfo_REF01_ReferenceIDQualifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[SubscriberAddInfo_REF01_ReferenceIDQualifierBAMFieldName]; }
      }

      public const string SubscriberAddInfo_REF01_ReferenceIDQualifierBAMFieldName = "SubscriberAddInfo_REF01_ReferenceIDQualifier";
 
      public string SubscriberAddInfo_REF02_PriorAuthorizationNumber
      {
        set { _activityItemHashtable.Add(SubscriberAddInfo_REF02_PriorAuthorizationNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[SubscriberAddInfo_REF02_PriorAuthorizationNumberBAMFieldName]; }
      }

      public const string SubscriberAddInfo_REF02_PriorAuthorizationNumberBAMFieldName = "SubscriberAddInfo_REF02_PriorAuthorizationNumber";
 
      public string SubscriberEligibility_DTP01_DateTimeQualifier
      {
        set { _activityItemHashtable.Add(SubscriberEligibility_DTP01_DateTimeQualifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[SubscriberEligibility_DTP01_DateTimeQualifierBAMFieldName]; }
      }

      public const string SubscriberEligibility_DTP01_DateTimeQualifierBAMFieldName = "SubscriberEligibility_DTP01_DateTimeQualifier";
 
      public string SubscriberEligibility_DTP02_DateTimePeriod
      {
        set { _activityItemHashtable.Add(SubscriberEligibility_DTP02_DateTimePeriodBAMFieldName,value); }
        get { return (string)_activityItemHashtable[SubscriberEligibility_DTP02_DateTimePeriodBAMFieldName]; }
      }

      public const string SubscriberEligibility_DTP02_DateTimePeriodBAMFieldName = "SubscriberEligibility_DTP02_DateTimePeriod";
 
      public string Subscriber_NM109_SubscriberPrimaryID
      {
        set { _activityItemHashtable.Add(Subscriber_NM109_SubscriberPrimaryIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[Subscriber_NM109_SubscriberPrimaryIDBAMFieldName]; }
      }

      public const string Subscriber_NM109_SubscriberPrimaryIDBAMFieldName = "Subscriber_NM109_SubscriberPrimaryID";
 
      public string IsDependent
      {
        set { _activityItemHashtable.Add(IsDependentBAMFieldName,value); }
        get { return (string)_activityItemHashtable[IsDependentBAMFieldName]; }
      }

      public const string IsDependentBAMFieldName = "IsDependent";
 
      public const string ActivityName = "EB_270_Details";
      private string _EB_270_DetailsID = null;
      private Hashtable _activityItemHashtable = new Hashtable();
    }
  
  #endregion

    #region Helper class for the EB_271_Details BAM activity
  
    public class EB_271_Details
    {
      public EB_271_Details(string EB_271_DetailsID)
      {
        _EB_271_DetailsID = EB_271_DetailsID;
      } 

      public string ActivityID
      {
        get { return _EB_271_DetailsID; }
      }	

      // Begin the EB_271_Details BAM activity
      public void BeginEB_271_DetailsActivity()
      {			
        // Begin the Activity using the passed identifier
        BufferedEventStream es = GetEventStream();
        es.BeginActivity(ActivityName ,_EB_271_DetailsID);
        
      }

      // Write any data changes to the _EB_271_Details activity
      // This must be called post any property changes
      public void CommitEB_271_DetailsActivity()
      {
        // We need to provide the key/value pairs to the BAM API
        ArrayList al = new ArrayList();								
        foreach (DictionaryEntry de in _activityItemHashtable)
        {
          al.Add(de.Key);
          al.Add(de.Value);
        }
        			
        // Update the BAM Activity with all of the data
        BufferedEventStream es = GetEventStream();
        es.UpdateActivity(ActivityName,_EB_271_DetailsID,al.ToArray() );	
              
      }

      // End the EB_271_Details BAM activity, no more changes will be permitted to this activity unless continuation is used
      public void EndEB_271_DetailsActivity()
      {
        // End this activity, no more data can be added.
        BufferedEventStream es = GetEventStream();
        es.EndActivity(ActivityName,_EB_271_DetailsID);
      }

      // Add a reference from this activity to another activity
      public void AddReferenceToAnotherActivity(string OtherActivityName, string OtherActivityID)
      {
        // Add a reference to another activity
        BufferedEventStream es = GetEventStream();
        es.AddReference(ActivityName,_EB_271_DetailsID,"Activity",OtherActivityName,OtherActivityID);
      }

      // Add a custom reference to this activity, this enables "data" to be attached to an activity such as a message body
      public void AddCustomReference(string referenceName, string referenceType, string referenceData, string longReferenceData)
      { 
        // Add a reference to another activity
        BufferedEventStream es = GetEventStream();
        es.AddReference(ActivityName,_EB_271_DetailsID,referenceName,referenceType,referenceData, longReferenceData);
      }

      
      public string Subscriber_TRN02_TraceNumber
      {
        set { _activityItemHashtable.Add(Subscriber_TRN02_TraceNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[Subscriber_TRN02_TraceNumberBAMFieldName]; }
      }

      public const string Subscriber_TRN02_TraceNumberBAMFieldName = "Subscriber_TRN02_TraceNumber";
 
      public string BenefitInfo_EB01_EligibilityOrBenefitInformation
      {
        set { _activityItemHashtable.Add(BenefitInfo_EB01_EligibilityOrBenefitInformationBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BenefitInfo_EB01_EligibilityOrBenefitInformationBAMFieldName]; }
      }

      public const string BenefitInfo_EB01_EligibilityOrBenefitInformationBAMFieldName = "BenefitInfo_EB01_EligibilityOrBenefitInformation";
 
      public string BenefitInfo_EB02_BenefitCoverageLevelCode
      {
        set { _activityItemHashtable.Add(BenefitInfo_EB02_BenefitCoverageLevelCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BenefitInfo_EB02_BenefitCoverageLevelCodeBAMFieldName]; }
      }

      public const string BenefitInfo_EB02_BenefitCoverageLevelCodeBAMFieldName = "BenefitInfo_EB02_BenefitCoverageLevelCode";
 
      public string BenefitInfo_EB03_ServiceTypeCode
      {
        set { _activityItemHashtable.Add(BenefitInfo_EB03_ServiceTypeCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BenefitInfo_EB03_ServiceTypeCodeBAMFieldName]; }
      }

      public const string BenefitInfo_EB03_ServiceTypeCodeBAMFieldName = "BenefitInfo_EB03_ServiceTypeCode";
 
      public string BenefitInfo_EB04_InsuranceTypeCode
      {
        set { _activityItemHashtable.Add(BenefitInfo_EB04_InsuranceTypeCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BenefitInfo_EB04_InsuranceTypeCodeBAMFieldName]; }
      }

      public const string BenefitInfo_EB04_InsuranceTypeCodeBAMFieldName = "BenefitInfo_EB04_InsuranceTypeCode";
 
      public string BenefitInfo_EB05_PlanCoverageDescription
      {
        set { _activityItemHashtable.Add(BenefitInfo_EB05_PlanCoverageDescriptionBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BenefitInfo_EB05_PlanCoverageDescriptionBAMFieldName]; }
      }

      public const string BenefitInfo_EB05_PlanCoverageDescriptionBAMFieldName = "BenefitInfo_EB05_PlanCoverageDescription";
 
      public string BenefitInfo_EB06_TimePeriodQualifier
      {
        set { _activityItemHashtable.Add(BenefitInfo_EB06_TimePeriodQualifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BenefitInfo_EB06_TimePeriodQualifierBAMFieldName]; }
      }

      public const string BenefitInfo_EB06_TimePeriodQualifierBAMFieldName = "BenefitInfo_EB06_TimePeriodQualifier";
 
      public string BenefitInfo_EB08_BenefitPercent
      {
        set { _activityItemHashtable.Add(BenefitInfo_EB08_BenefitPercentBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BenefitInfo_EB08_BenefitPercentBAMFieldName]; }
      }

      public const string BenefitInfo_EB08_BenefitPercentBAMFieldName = "BenefitInfo_EB08_BenefitPercent";
 
      public decimal BenefitInfo_EB07_BenefitAmount
      {
        set { _activityItemHashtable.Add(BenefitInfo_EB07_BenefitAmountBAMFieldName,value); }
        get { return (decimal)_activityItemHashtable[BenefitInfo_EB07_BenefitAmountBAMFieldName]; }
      }

      public const string BenefitInfo_EB07_BenefitAmountBAMFieldName = "BenefitInfo_EB07_BenefitAmount";
 
      public string BenefitInfo_EB09_QuantityQualifier
      {
        set { _activityItemHashtable.Add(BenefitInfo_EB09_QuantityQualifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BenefitInfo_EB09_QuantityQualifierBAMFieldName]; }
      }

      public const string BenefitInfo_EB09_QuantityQualifierBAMFieldName = "BenefitInfo_EB09_QuantityQualifier";
 
      public int BenefitInfo_EB10_BenefitQuantity
      {
        set { _activityItemHashtable.Add(BenefitInfo_EB10_BenefitQuantityBAMFieldName,value); }
        get { return (int)_activityItemHashtable[BenefitInfo_EB10_BenefitQuantityBAMFieldName]; }
      }

      public const string BenefitInfo_EB10_BenefitQuantityBAMFieldName = "BenefitInfo_EB10_BenefitQuantity";
 
      public string BenefitInfo_EB11_AuthOrCertificationIndicator
      {
        set { _activityItemHashtable.Add(BenefitInfo_EB11_AuthOrCertificationIndicatorBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BenefitInfo_EB11_AuthOrCertificationIndicatorBAMFieldName]; }
      }

      public const string BenefitInfo_EB11_AuthOrCertificationIndicatorBAMFieldName = "BenefitInfo_EB11_AuthOrCertificationIndicator";
 
      public string BenefitInfo_EB12_InPlanNetworkIndicator
      {
        set { _activityItemHashtable.Add(BenefitInfo_EB12_InPlanNetworkIndicatorBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BenefitInfo_EB12_InPlanNetworkIndicatorBAMFieldName]; }
      }

      public const string BenefitInfo_EB12_InPlanNetworkIndicatorBAMFieldName = "BenefitInfo_EB12_InPlanNetworkIndicator";
 
      public string BenefitInfo_REF01_ReferenceIdentificationQualifier
      {
        set { _activityItemHashtable.Add(BenefitInfo_REF01_ReferenceIdentificationQualifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BenefitInfo_REF01_ReferenceIdentificationQualifierBAMFieldName]; }
      }

      public const string BenefitInfo_REF01_ReferenceIdentificationQualifierBAMFieldName = "BenefitInfo_REF01_ReferenceIdentificationQualifier";
 
      public string BenefitInfo_REF02_SubscriberEligibilityOrBenefitID
      {
        set { _activityItemHashtable.Add(BenefitInfo_REF02_SubscriberEligibilityOrBenefitIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BenefitInfo_REF02_SubscriberEligibilityOrBenefitIDBAMFieldName]; }
      }

      public const string BenefitInfo_REF02_SubscriberEligibilityOrBenefitIDBAMFieldName = "BenefitInfo_REF02_SubscriberEligibilityOrBenefitID";
 
      public string BenefitInfo_REF03_PlanSponsorName
      {
        set { _activityItemHashtable.Add(BenefitInfo_REF03_PlanSponsorNameBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BenefitInfo_REF03_PlanSponsorNameBAMFieldName]; }
      }

      public const string BenefitInfo_REF03_PlanSponsorNameBAMFieldName = "BenefitInfo_REF03_PlanSponsorName";
 
      public string BenefitInfo_MSG01_FreeFormMessageText
      {
        set { _activityItemHashtable.Add(BenefitInfo_MSG01_FreeFormMessageTextBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BenefitInfo_MSG01_FreeFormMessageTextBAMFieldName]; }
      }

      public const string BenefitInfo_MSG01_FreeFormMessageTextBAMFieldName = "BenefitInfo_MSG01_FreeFormMessageText";
 
      public string BenefitInfo_EB13_ProcedureCode
      {
        set { _activityItemHashtable.Add(BenefitInfo_EB13_ProcedureCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BenefitInfo_EB13_ProcedureCodeBAMFieldName]; }
      }

      public const string BenefitInfo_EB13_ProcedureCodeBAMFieldName = "BenefitInfo_EB13_ProcedureCode";
 
      public string BenefitInfo_EB13_ProductOrServiceIDQualifier
      {
        set { _activityItemHashtable.Add(BenefitInfo_EB13_ProductOrServiceIDQualifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BenefitInfo_EB13_ProductOrServiceIDQualifierBAMFieldName]; }
      }

      public const string BenefitInfo_EB13_ProductOrServiceIDQualifierBAMFieldName = "BenefitInfo_EB13_ProductOrServiceIDQualifier";
 
      public string IsDependent
      {
        set { _activityItemHashtable.Add(IsDependentBAMFieldName,value); }
        get { return (string)_activityItemHashtable[IsDependentBAMFieldName]; }
      }

      public const string IsDependentBAMFieldName = "IsDependent";
 
      public const string ActivityName = "EB_271_Details";
      private string _EB_271_DetailsID = null;
      private Hashtable _activityItemHashtable = new Hashtable();
    }
  
  #endregion

    #region Helper class for the Availity_Realtime_Messaging BAM activity
  
    public class Availity_Realtime_Messaging
    {
      public Availity_Realtime_Messaging(string Availity_Realtime_MessagingID)
      {
        _Availity_Realtime_MessagingID = Availity_Realtime_MessagingID;
      } 

      public string ActivityID
      {
        get { return _Availity_Realtime_MessagingID; }
      }	

      // Begin the Availity_Realtime_Messaging BAM activity
      public void BeginAvaility_Realtime_MessagingActivity()
      {			
        // Begin the Activity using the passed identifier
        BufferedEventStream es = GetEventStream();
        es.BeginActivity(ActivityName ,_Availity_Realtime_MessagingID);
        
      }

      // Write any data changes to the _Availity_Realtime_Messaging activity
      // This must be called post any property changes
      public void CommitAvaility_Realtime_MessagingActivity()
      {
        // We need to provide the key/value pairs to the BAM API
        ArrayList al = new ArrayList();								
        foreach (DictionaryEntry de in _activityItemHashtable)
        {
          al.Add(de.Key);
          al.Add(de.Value);
        }
        			
        // Update the BAM Activity with all of the data
        BufferedEventStream es = GetEventStream();
        es.UpdateActivity(ActivityName,_Availity_Realtime_MessagingID,al.ToArray() );	
              
      }

      // End the Availity_Realtime_Messaging BAM activity, no more changes will be permitted to this activity unless continuation is used
      public void EndAvaility_Realtime_MessagingActivity()
      {
        // End this activity, no more data can be added.
        BufferedEventStream es = GetEventStream();
        es.EndActivity(ActivityName,_Availity_Realtime_MessagingID);
      }

      // Add a reference from this activity to another activity
      public void AddReferenceToAnotherActivity(string OtherActivityName, string OtherActivityID)
      {
        // Add a reference to another activity
        BufferedEventStream es = GetEventStream();
        es.AddReference(ActivityName,_Availity_Realtime_MessagingID,"Activity",OtherActivityName,OtherActivityID);
      }

      // Add a custom reference to this activity, this enables "data" to be attached to an activity such as a message body
      public void AddCustomReference(string referenceName, string referenceType, string referenceData, string longReferenceData)
      { 
        // Add a reference to another activity
        BufferedEventStream es = GetEventStream();
        es.AddReference(ActivityName,_Availity_Realtime_MessagingID,referenceName,referenceType,referenceData, longReferenceData);
      }

      
      public string TranCode
      {
        set { _activityItemHashtable.Add(TranCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[TranCodeBAMFieldName]; }
      }

      public const string TranCodeBAMFieldName = "TranCode";
 
      public string MessageFormat
      {
        set { _activityItemHashtable.Add(MessageFormatBAMFieldName,value); }
        get { return (string)_activityItemHashtable[MessageFormatBAMFieldName]; }
      }

      public const string MessageFormatBAMFieldName = "MessageFormat";
 
      public string Sender
      {
        set { _activityItemHashtable.Add(SenderBAMFieldName,value); }
        get { return (string)_activityItemHashtable[SenderBAMFieldName]; }
      }

      public const string SenderBAMFieldName = "Sender";
 
      public string Receiver
      {
        set { _activityItemHashtable.Add(ReceiverBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ReceiverBAMFieldName]; }
      }

      public const string ReceiverBAMFieldName = "Receiver";
 
      public string Session
      {
        set { _activityItemHashtable.Add(SessionBAMFieldName,value); }
        get { return (string)_activityItemHashtable[SessionBAMFieldName]; }
      }

      public const string SessionBAMFieldName = "Session";
 
      public string ProviderOfficeNumber
      {
        set { _activityItemHashtable.Add(ProviderOfficeNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ProviderOfficeNumberBAMFieldName]; }
      }

      public const string ProviderOfficeNumberBAMFieldName = "ProviderOfficeNumber";
 
      public string ProviderTransactionID
      {
        set { _activityItemHashtable.Add(ProviderTransactionIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ProviderTransactionIDBAMFieldName]; }
      }

      public const string ProviderTransactionIDBAMFieldName = "ProviderTransactionID";
 
      public string BTSMessageID_HTTPRequest
      {
        set { _activityItemHashtable.Add(BTSMessageID_HTTPRequestBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSMessageID_HTTPRequestBAMFieldName]; }
      }

      public const string BTSMessageID_HTTPRequestBAMFieldName = "BTSMessageID_HTTPRequest";
 
      public string BTSInterchangeID
      {
        set { _activityItemHashtable.Add(BTSInterchangeIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSInterchangeIDBAMFieldName]; }
      }

      public const string BTSInterchangeIDBAMFieldName = "BTSInterchangeID";
 
      public string UniqueIdentfier
      {
        set { _activityItemHashtable.Add(UniqueIdentfierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[UniqueIdentfierBAMFieldName]; }
      }

      public const string UniqueIdentfierBAMFieldName = "UniqueIdentfier";
 
      public DateTime MessageRequestDate
      {
        set { _activityItemHashtable.Add(MessageRequestDateBAMFieldName,value); }
        get { return (DateTime)_activityItemHashtable[MessageRequestDateBAMFieldName]; }
      }

      public const string MessageRequestDateBAMFieldName = "MessageRequestDate";
 
      public DateTime MessageResponseDate
      {
        set { _activityItemHashtable.Add(MessageResponseDateBAMFieldName,value); }
        get { return (DateTime)_activityItemHashtable[MessageResponseDateBAMFieldName]; }
      }

      public const string MessageResponseDateBAMFieldName = "MessageResponseDate";
 
      public string ResponseMessageFormat
      {
        set { _activityItemHashtable.Add(ResponseMessageFormatBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ResponseMessageFormatBAMFieldName]; }
      }

      public const string ResponseMessageFormatBAMFieldName = "ResponseMessageFormat";
 
      public string ResponseErrorCode
      {
        set { _activityItemHashtable.Add(ResponseErrorCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ResponseErrorCodeBAMFieldName]; }
      }

      public const string ResponseErrorCodeBAMFieldName = "ResponseErrorCode";
 
      public string ResponseErrorDescription
      {
        set { _activityItemHashtable.Add(ResponseErrorDescriptionBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ResponseErrorDescriptionBAMFieldName]; }
      }

      public const string ResponseErrorDescriptionBAMFieldName = "ResponseErrorDescription";
 
      public string ResponseTransactionType
      {
        set { _activityItemHashtable.Add(ResponseTransactionTypeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ResponseTransactionTypeBAMFieldName]; }
      }

      public const string ResponseTransactionTypeBAMFieldName = "ResponseTransactionType";
 
      public string ResponseSessionID
      {
        set { _activityItemHashtable.Add(ResponseSessionIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ResponseSessionIDBAMFieldName]; }
      }

      public const string ResponseSessionIDBAMFieldName = "ResponseSessionID";
 
      public string ResponseMessageType
      {
        set { _activityItemHashtable.Add(ResponseMessageTypeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ResponseMessageTypeBAMFieldName]; }
      }

      public const string ResponseMessageTypeBAMFieldName = "ResponseMessageType";
 
      public string AXIMLSender
      {
        set { _activityItemHashtable.Add(AXIMLSenderBAMFieldName,value); }
        get { return (string)_activityItemHashtable[AXIMLSenderBAMFieldName]; }
      }

      public const string AXIMLSenderBAMFieldName = "AXIMLSender";
 
      public string AXIMLReceiver
      {
        set { _activityItemHashtable.Add(AXIMLReceiverBAMFieldName,value); }
        get { return (string)_activityItemHashtable[AXIMLReceiverBAMFieldName]; }
      }

      public const string AXIMLReceiverBAMFieldName = "AXIMLReceiver";
 
      public string AXIMLTransDate
      {
        set { _activityItemHashtable.Add(AXIMLTransDateBAMFieldName,value); }
        get { return (string)_activityItemHashtable[AXIMLTransDateBAMFieldName]; }
      }

      public const string AXIMLTransDateBAMFieldName = "AXIMLTransDate";
 
      public string AXIMLTransTime
      {
        set { _activityItemHashtable.Add(AXIMLTransTimeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[AXIMLTransTimeBAMFieldName]; }
      }

      public const string AXIMLTransTimeBAMFieldName = "AXIMLTransTime";
 
      public string AXIMLTestProd
      {
        set { _activityItemHashtable.Add(AXIMLTestProdBAMFieldName,value); }
        get { return (string)_activityItemHashtable[AXIMLTestProdBAMFieldName]; }
      }

      public const string AXIMLTestProdBAMFieldName = "AXIMLTestProd";
 
      public string AXIMLTransID
      {
        set { _activityItemHashtable.Add(AXIMLTransIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[AXIMLTransIDBAMFieldName]; }
      }

      public const string AXIMLTransIDBAMFieldName = "AXIMLTransID";
 
      public string AXIMLSenderTransID
      {
        set { _activityItemHashtable.Add(AXIMLSenderTransIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[AXIMLSenderTransIDBAMFieldName]; }
      }

      public const string AXIMLSenderTransIDBAMFieldName = "AXIMLSenderTransID";
 
      public string AXIMLMessageText
      {
        set { _activityItemHashtable.Add(AXIMLMessageTextBAMFieldName,value); }
        get { return (string)_activityItemHashtable[AXIMLMessageTextBAMFieldName]; }
      }

      public const string AXIMLMessageTextBAMFieldName = "AXIMLMessageText";
 
      public string AXIMLInfoReceiverOrgName
      {
        set { _activityItemHashtable.Add(AXIMLInfoReceiverOrgNameBAMFieldName,value); }
        get { return (string)_activityItemHashtable[AXIMLInfoReceiverOrgNameBAMFieldName]; }
      }

      public const string AXIMLInfoReceiverOrgNameBAMFieldName = "AXIMLInfoReceiverOrgName";
 
      public string AXIMLInfoReceiverSiteID
      {
        set { _activityItemHashtable.Add(AXIMLInfoReceiverSiteIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[AXIMLInfoReceiverSiteIDBAMFieldName]; }
      }

      public const string AXIMLInfoReceiverSiteIDBAMFieldName = "AXIMLInfoReceiverSiteID";
 
      public string AXIMLInfoReceiverAKAName
      {
        set { _activityItemHashtable.Add(AXIMLInfoReceiverAKANameBAMFieldName,value); }
        get { return (string)_activityItemHashtable[AXIMLInfoReceiverAKANameBAMFieldName]; }
      }

      public const string AXIMLInfoReceiverAKANameBAMFieldName = "AXIMLInfoReceiverAKAName";
 
      public string AXIMLEDIVersionNumber
      {
        set { _activityItemHashtable.Add(AXIMLEDIVersionNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[AXIMLEDIVersionNumberBAMFieldName]; }
      }

      public const string AXIMLEDIVersionNumberBAMFieldName = "AXIMLEDIVersionNumber";
 
      public string AXIMLTransCode
      {
        set { _activityItemHashtable.Add(AXIMLTransCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[AXIMLTransCodeBAMFieldName]; }
      }

      public const string AXIMLTransCodeBAMFieldName = "AXIMLTransCode";
 
      public string BTSMessageID_OriginalRequest
      {
        set { _activityItemHashtable.Add(BTSMessageID_OriginalRequestBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSMessageID_OriginalRequestBAMFieldName]; }
      }

      public const string BTSMessageID_OriginalRequestBAMFieldName = "BTSMessageID_OriginalRequest";
 
      public const string ActivityName = "Availity_Realtime_Messaging";
      private string _Availity_Realtime_MessagingID = null;
      private Hashtable _activityItemHashtable = new Hashtable();
    }
  
  #endregion

    #region Helper class for the Availity_Realtime_Messaging_PayerErrors BAM activity
  
    public class Availity_Realtime_Messaging_PayerErrors
    {
      public Availity_Realtime_Messaging_PayerErrors(string Availity_Realtime_Messaging_PayerErrorsID)
      {
        _Availity_Realtime_Messaging_PayerErrorsID = Availity_Realtime_Messaging_PayerErrorsID;
      } 

      public string ActivityID
      {
        get { return _Availity_Realtime_Messaging_PayerErrorsID; }
      }	

      // Begin the Availity_Realtime_Messaging_PayerErrors BAM activity
      public void BeginAvaility_Realtime_Messaging_PayerErrorsActivity()
      {			
        // Begin the Activity using the passed identifier
        BufferedEventStream es = GetEventStream();
        es.BeginActivity(ActivityName ,_Availity_Realtime_Messaging_PayerErrorsID);
        
      }

      // Write any data changes to the _Availity_Realtime_Messaging_PayerErrors activity
      // This must be called post any property changes
      public void CommitAvaility_Realtime_Messaging_PayerErrorsActivity()
      {
        // We need to provide the key/value pairs to the BAM API
        ArrayList al = new ArrayList();								
        foreach (DictionaryEntry de in _activityItemHashtable)
        {
          al.Add(de.Key);
          al.Add(de.Value);
        }
        			
        // Update the BAM Activity with all of the data
        BufferedEventStream es = GetEventStream();
        es.UpdateActivity(ActivityName,_Availity_Realtime_Messaging_PayerErrorsID,al.ToArray() );	
              
      }

      // End the Availity_Realtime_Messaging_PayerErrors BAM activity, no more changes will be permitted to this activity unless continuation is used
      public void EndAvaility_Realtime_Messaging_PayerErrorsActivity()
      {
        // End this activity, no more data can be added.
        BufferedEventStream es = GetEventStream();
        es.EndActivity(ActivityName,_Availity_Realtime_Messaging_PayerErrorsID);
      }

      // Add a reference from this activity to another activity
      public void AddReferenceToAnotherActivity(string OtherActivityName, string OtherActivityID)
      {
        // Add a reference to another activity
        BufferedEventStream es = GetEventStream();
        es.AddReference(ActivityName,_Availity_Realtime_Messaging_PayerErrorsID,"Activity",OtherActivityName,OtherActivityID);
      }

      // Add a custom reference to this activity, this enables "data" to be attached to an activity such as a message body
      public void AddCustomReference(string referenceName, string referenceType, string referenceData, string longReferenceData)
      { 
        // Add a reference to another activity
        BufferedEventStream es = GetEventStream();
        es.AddReference(ActivityName,_Availity_Realtime_Messaging_PayerErrorsID,referenceName,referenceType,referenceData, longReferenceData);
      }

      
      public string ErrorRow
      {
        set { _activityItemHashtable.Add(ErrorRowBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ErrorRowBAMFieldName]; }
      }

      public const string ErrorRowBAMFieldName = "ErrorRow";
 
      public string ErrorCode
      {
        set { _activityItemHashtable.Add(ErrorCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ErrorCodeBAMFieldName]; }
      }

      public const string ErrorCodeBAMFieldName = "ErrorCode";
 
      public string Followup
      {
        set { _activityItemHashtable.Add(FollowupBAMFieldName,value); }
        get { return (string)_activityItemHashtable[FollowupBAMFieldName]; }
      }

      public const string FollowupBAMFieldName = "Followup";
 
      public string HIPAAText
      {
        set { _activityItemHashtable.Add(HIPAATextBAMFieldName,value); }
        get { return (string)_activityItemHashtable[HIPAATextBAMFieldName]; }
      }

      public const string HIPAATextBAMFieldName = "HIPAAText";
 
      public string BTSMessageID
      {
        set { _activityItemHashtable.Add(BTSMessageIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSMessageIDBAMFieldName]; }
      }

      public const string BTSMessageIDBAMFieldName = "BTSMessageID";
 
      public string BTSInterchangeID
      {
        set { _activityItemHashtable.Add(BTSInterchangeIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSInterchangeIDBAMFieldName]; }
      }

      public const string BTSInterchangeIDBAMFieldName = "BTSInterchangeID";
 
      public const string ActivityName = "Availity_Realtime_Messaging_PayerErrors";
      private string _Availity_Realtime_Messaging_PayerErrorsID = null;
      private Hashtable _activityItemHashtable = new Hashtable();
    }
  
  #endregion

    #region Helper class for the ClaimMessagingStatistics BAM activity
  
    public class ClaimMessagingStatistics
    {
      public ClaimMessagingStatistics(string ClaimMessagingStatisticsID)
      {
        _ClaimMessagingStatisticsID = ClaimMessagingStatisticsID;
      } 

      public string ActivityID
      {
        get { return _ClaimMessagingStatisticsID; }
      }	

      // Begin the ClaimMessagingStatistics BAM activity
      public void BeginClaimMessagingStatisticsActivity()
      {			
        // Begin the Activity using the passed identifier
        BufferedEventStream es = GetEventStream();
        es.BeginActivity(ActivityName ,_ClaimMessagingStatisticsID);
        
      }

      // Write any data changes to the _ClaimMessagingStatistics activity
      // This must be called post any property changes
      public void CommitClaimMessagingStatisticsActivity()
      {
        // We need to provide the key/value pairs to the BAM API
        ArrayList al = new ArrayList();								
        foreach (DictionaryEntry de in _activityItemHashtable)
        {
          al.Add(de.Key);
          al.Add(de.Value);
        }
        			
        // Update the BAM Activity with all of the data
        BufferedEventStream es = GetEventStream();
        es.UpdateActivity(ActivityName,_ClaimMessagingStatisticsID,al.ToArray() );	
              
      }

      // End the ClaimMessagingStatistics BAM activity, no more changes will be permitted to this activity unless continuation is used
      public void EndClaimMessagingStatisticsActivity()
      {
        // End this activity, no more data can be added.
        BufferedEventStream es = GetEventStream();
        es.EndActivity(ActivityName,_ClaimMessagingStatisticsID);
      }

      // Add a reference from this activity to another activity
      public void AddReferenceToAnotherActivity(string OtherActivityName, string OtherActivityID)
      {
        // Add a reference to another activity
        BufferedEventStream es = GetEventStream();
        es.AddReference(ActivityName,_ClaimMessagingStatisticsID,"Activity",OtherActivityName,OtherActivityID);
      }

      // Add a custom reference to this activity, this enables "data" to be attached to an activity such as a message body
      public void AddCustomReference(string referenceName, string referenceType, string referenceData, string longReferenceData)
      { 
        // Add a reference to another activity
        BufferedEventStream es = GetEventStream();
        es.AddReference(ActivityName,_ClaimMessagingStatisticsID,referenceName,referenceType,referenceData, longReferenceData);
      }

      
      public string MessageType
      {
        set { _activityItemHashtable.Add(MessageTypeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[MessageTypeBAMFieldName]; }
      }

      public const string MessageTypeBAMFieldName = "MessageType";
 
      public string MessageDirection
      {
        set { _activityItemHashtable.Add(MessageDirectionBAMFieldName,value); }
        get { return (string)_activityItemHashtable[MessageDirectionBAMFieldName]; }
      }

      public const string MessageDirectionBAMFieldName = "MessageDirection";
 
      public string OrchestrationName
      {
        set { _activityItemHashtable.Add(OrchestrationNameBAMFieldName,value); }
        get { return (string)_activityItemHashtable[OrchestrationNameBAMFieldName]; }
      }

      public const string OrchestrationNameBAMFieldName = "OrchestrationName";
 
      public DateTime MessageStartTime
      {
        set { _activityItemHashtable.Add(MessageStartTimeBAMFieldName,value); }
        get { return (DateTime)_activityItemHashtable[MessageStartTimeBAMFieldName]; }
      }

      public const string MessageStartTimeBAMFieldName = "MessageStartTime";
 
      public DateTime MessageEndTime
      {
        set { _activityItemHashtable.Add(MessageEndTimeBAMFieldName,value); }
        get { return (DateTime)_activityItemHashtable[MessageEndTimeBAMFieldName]; }
      }

      public const string MessageEndTimeBAMFieldName = "MessageEndTime";
 
      public string MessageSource
      {
        set { _activityItemHashtable.Add(MessageSourceBAMFieldName,value); }
        get { return (string)_activityItemHashtable[MessageSourceBAMFieldName]; }
      }

      public const string MessageSourceBAMFieldName = "MessageSource";
 
      public string MessageDestination
      {
        set { _activityItemHashtable.Add(MessageDestinationBAMFieldName,value); }
        get { return (string)_activityItemHashtable[MessageDestinationBAMFieldName]; }
      }

      public const string MessageDestinationBAMFieldName = "MessageDestination";
 
      public decimal NumberOfChildMessages
      {
        set { _activityItemHashtable.Add(NumberOfChildMessagesBAMFieldName,value); }
        get { return (decimal)_activityItemHashtable[NumberOfChildMessagesBAMFieldName]; }
      }

      public const string NumberOfChildMessagesBAMFieldName = "NumberOfChildMessages";
 
      public string BTSMessageID
      {
        set { _activityItemHashtable.Add(BTSMessageIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSMessageIDBAMFieldName]; }
      }

      public const string BTSMessageIDBAMFieldName = "BTSMessageID";
 
      public string BTSInterchangeID
      {
        set { _activityItemHashtable.Add(BTSInterchangeIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSInterchangeIDBAMFieldName]; }
      }

      public const string BTSInterchangeIDBAMFieldName = "BTSInterchangeID";
 
      public string MessageCommunicationMethod
      {
        set { _activityItemHashtable.Add(MessageCommunicationMethodBAMFieldName,value); }
        get { return (string)_activityItemHashtable[MessageCommunicationMethodBAMFieldName]; }
      }

      public const string MessageCommunicationMethodBAMFieldName = "MessageCommunicationMethod";
 
      public string MessageTransmissionSuccessful
      {
        set { _activityItemHashtable.Add(MessageTransmissionSuccessfulBAMFieldName,value); }
        get { return (string)_activityItemHashtable[MessageTransmissionSuccessfulBAMFieldName]; }
      }

      public const string MessageTransmissionSuccessfulBAMFieldName = "MessageTransmissionSuccessful";
 
      public string MessageValidationSuccessful
      {
        set { _activityItemHashtable.Add(MessageValidationSuccessfulBAMFieldName,value); }
        get { return (string)_activityItemHashtable[MessageValidationSuccessfulBAMFieldName]; }
      }

      public const string MessageValidationSuccessfulBAMFieldName = "MessageValidationSuccessful";
 
      public const string ActivityName = "ClaimMessagingStatistics";
      private string _ClaimMessagingStatisticsID = null;
      private Hashtable _activityItemHashtable = new Hashtable();
    }
  
  #endregion

    #region Helper class for the EDI_Correlation BAM activity
  
    public class EDI_Correlation
    {
      public EDI_Correlation(string EDI_CorrelationID)
      {
        _EDI_CorrelationID = EDI_CorrelationID;
      } 

      public string ActivityID
      {
        get { return _EDI_CorrelationID; }
      }	

      // Begin the EDI_Correlation BAM activity
      public void BeginEDI_CorrelationActivity()
      {			
        // Begin the Activity using the passed identifier
        BufferedEventStream es = GetEventStream();
        es.BeginActivity(ActivityName ,_EDI_CorrelationID);
        
      }

      // Write any data changes to the _EDI_Correlation activity
      // This must be called post any property changes
      public void CommitEDI_CorrelationActivity()
      {
        // We need to provide the key/value pairs to the BAM API
        ArrayList al = new ArrayList();								
        foreach (DictionaryEntry de in _activityItemHashtable)
        {
          al.Add(de.Key);
          al.Add(de.Value);
        }
        			
        // Update the BAM Activity with all of the data
        BufferedEventStream es = GetEventStream();
        es.UpdateActivity(ActivityName,_EDI_CorrelationID,al.ToArray() );	
              
      }

      // End the EDI_Correlation BAM activity, no more changes will be permitted to this activity unless continuation is used
      public void EndEDI_CorrelationActivity()
      {
        // End this activity, no more data can be added.
        BufferedEventStream es = GetEventStream();
        es.EndActivity(ActivityName,_EDI_CorrelationID);
      }

      // Add a reference from this activity to another activity
      public void AddReferenceToAnotherActivity(string OtherActivityName, string OtherActivityID)
      {
        // Add a reference to another activity
        BufferedEventStream es = GetEventStream();
        es.AddReference(ActivityName,_EDI_CorrelationID,"Activity",OtherActivityName,OtherActivityID);
      }

      // Add a custom reference to this activity, this enables "data" to be attached to an activity such as a message body
      public void AddCustomReference(string referenceName, string referenceType, string referenceData, string longReferenceData)
      { 
        // Add a reference to another activity
        BufferedEventStream es = GetEventStream();
        es.AddReference(ActivityName,_EDI_CorrelationID,referenceName,referenceType,referenceData, longReferenceData);
      }

      
      public string BTSMessageID
      {
        set { _activityItemHashtable.Add(BTSMessageIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSMessageIDBAMFieldName]; }
      }

      public const string BTSMessageIDBAMFieldName = "BTSMessageID";
 
      public string BTSInterchangeID
      {
        set { _activityItemHashtable.Add(BTSInterchangeIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSInterchangeIDBAMFieldName]; }
      }

      public const string BTSInterchangeIDBAMFieldName = "BTSInterchangeID";
 
      public string ISA13_New_InterchangeControlNumber
      {
        set { _activityItemHashtable.Add(ISA13_New_InterchangeControlNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ISA13_New_InterchangeControlNumberBAMFieldName]; }
      }

      public const string ISA13_New_InterchangeControlNumberBAMFieldName = "ISA13_New_InterchangeControlNumber";
 
      public string ISA13_Original_InterchangeControlNumber
      {
        set { _activityItemHashtable.Add(ISA13_Original_InterchangeControlNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ISA13_Original_InterchangeControlNumberBAMFieldName]; }
      }

      public const string ISA13_Original_InterchangeControlNumberBAMFieldName = "ISA13_Original_InterchangeControlNumber";
 
      public string GS06_New_GroupConrolNumber
      {
        set { _activityItemHashtable.Add(GS06_New_GroupConrolNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[GS06_New_GroupConrolNumberBAMFieldName]; }
      }

      public const string GS06_New_GroupConrolNumberBAMFieldName = "GS06_New_GroupConrolNumber";
 
      public string GS06_Original_GroupControlNumber
      {
        set { _activityItemHashtable.Add(GS06_Original_GroupControlNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[GS06_Original_GroupControlNumberBAMFieldName]; }
      }

      public const string GS06_Original_GroupControlNumberBAMFieldName = "GS06_Original_GroupControlNumber";
 
      public string ST02_New_TransactionSetControlNumber
      {
        set { _activityItemHashtable.Add(ST02_New_TransactionSetControlNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ST02_New_TransactionSetControlNumberBAMFieldName]; }
      }

      public const string ST02_New_TransactionSetControlNumberBAMFieldName = "ST02_New_TransactionSetControlNumber";
 
      public string ST02_Original_TransactionSetControlNumber
      {
        set { _activityItemHashtable.Add(ST02_Original_TransactionSetControlNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ST02_Original_TransactionSetControlNumberBAMFieldName]; }
      }

      public const string ST02_Original_TransactionSetControlNumberBAMFieldName = "ST02_Original_TransactionSetControlNumber";
 
      public string BTSMessageID_Original
      {
        set { _activityItemHashtable.Add(BTSMessageID_OriginalBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSMessageID_OriginalBAMFieldName]; }
      }

      public const string BTSMessageID_OriginalBAMFieldName = "BTSMessageID_Original";
 
      public string ST01_TransactionSetIDCode
      {
        set { _activityItemHashtable.Add(ST01_TransactionSetIDCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ST01_TransactionSetIDCodeBAMFieldName]; }
      }

      public const string ST01_TransactionSetIDCodeBAMFieldName = "ST01_TransactionSetIDCode";
 
      public string BTSInterchangeID_Original
      {
        set { _activityItemHashtable.Add(BTSInterchangeID_OriginalBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSInterchangeID_OriginalBAMFieldName]; }
      }

      public const string BTSInterchangeID_OriginalBAMFieldName = "BTSInterchangeID_Original";
 
      public const string ActivityName = "EDI_Correlation";
      private string _EDI_CorrelationID = null;
      private Hashtable _activityItemHashtable = new Hashtable();
    }
  
  #endregion

    #region Helper class for the EDI_Envelope_Interchange BAM activity
  
    public class EDI_Envelope_Interchange
    {
      public EDI_Envelope_Interchange(string EDI_Envelope_InterchangeID)
      {
        _EDI_Envelope_InterchangeID = EDI_Envelope_InterchangeID;
      } 

      public string ActivityID
      {
        get { return _EDI_Envelope_InterchangeID; }
      }	

      // Begin the EDI_Envelope_Interchange BAM activity
      public void BeginEDI_Envelope_InterchangeActivity()
      {			
        // Begin the Activity using the passed identifier
        BufferedEventStream es = GetEventStream();
        es.BeginActivity(ActivityName ,_EDI_Envelope_InterchangeID);
        
      }

      // Write any data changes to the _EDI_Envelope_Interchange activity
      // This must be called post any property changes
      public void CommitEDI_Envelope_InterchangeActivity()
      {
        // We need to provide the key/value pairs to the BAM API
        ArrayList al = new ArrayList();								
        foreach (DictionaryEntry de in _activityItemHashtable)
        {
          al.Add(de.Key);
          al.Add(de.Value);
        }
        			
        // Update the BAM Activity with all of the data
        BufferedEventStream es = GetEventStream();
        es.UpdateActivity(ActivityName,_EDI_Envelope_InterchangeID,al.ToArray() );	
              
      }

      // End the EDI_Envelope_Interchange BAM activity, no more changes will be permitted to this activity unless continuation is used
      public void EndEDI_Envelope_InterchangeActivity()
      {
        // End this activity, no more data can be added.
        BufferedEventStream es = GetEventStream();
        es.EndActivity(ActivityName,_EDI_Envelope_InterchangeID);
      }

      // Add a reference from this activity to another activity
      public void AddReferenceToAnotherActivity(string OtherActivityName, string OtherActivityID)
      {
        // Add a reference to another activity
        BufferedEventStream es = GetEventStream();
        es.AddReference(ActivityName,_EDI_Envelope_InterchangeID,"Activity",OtherActivityName,OtherActivityID);
      }

      // Add a custom reference to this activity, this enables "data" to be attached to an activity such as a message body
      public void AddCustomReference(string referenceName, string referenceType, string referenceData, string longReferenceData)
      { 
        // Add a reference to another activity
        BufferedEventStream es = GetEventStream();
        es.AddReference(ActivityName,_EDI_Envelope_InterchangeID,referenceName,referenceType,referenceData, longReferenceData);
      }

      
      public string BTSMessageID
      {
        set { _activityItemHashtable.Add(BTSMessageIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSMessageIDBAMFieldName]; }
      }

      public const string BTSMessageIDBAMFieldName = "BTSMessageID";
 
      public string BTSInterchangeID
      {
        set { _activityItemHashtable.Add(BTSInterchangeIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSInterchangeIDBAMFieldName]; }
      }

      public const string BTSInterchangeIDBAMFieldName = "BTSInterchangeID";
 
      public string ISA01_AuthorizationQualifier
      {
        set { _activityItemHashtable.Add(ISA01_AuthorizationQualifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ISA01_AuthorizationQualifierBAMFieldName]; }
      }

      public const string ISA01_AuthorizationQualifierBAMFieldName = "ISA01_AuthorizationQualifier";
 
      public string ISA02_AuthorizationInformation
      {
        set { _activityItemHashtable.Add(ISA02_AuthorizationInformationBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ISA02_AuthorizationInformationBAMFieldName]; }
      }

      public const string ISA02_AuthorizationInformationBAMFieldName = "ISA02_AuthorizationInformation";
 
      public string ISA03_SecurityQualifier
      {
        set { _activityItemHashtable.Add(ISA03_SecurityQualifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ISA03_SecurityQualifierBAMFieldName]; }
      }

      public const string ISA03_SecurityQualifierBAMFieldName = "ISA03_SecurityQualifier";
 
      public string ISA04_SecurityInformation
      {
        set { _activityItemHashtable.Add(ISA04_SecurityInformationBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ISA04_SecurityInformationBAMFieldName]; }
      }

      public const string ISA04_SecurityInformationBAMFieldName = "ISA04_SecurityInformation";
 
      public string ISA05_SenderQualifier
      {
        set { _activityItemHashtable.Add(ISA05_SenderQualifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ISA05_SenderQualifierBAMFieldName]; }
      }

      public const string ISA05_SenderQualifierBAMFieldName = "ISA05_SenderQualifier";
 
      public string ISA06_SenderID
      {
        set { _activityItemHashtable.Add(ISA06_SenderIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ISA06_SenderIDBAMFieldName]; }
      }

      public const string ISA06_SenderIDBAMFieldName = "ISA06_SenderID";
 
      public string ISA07_ReceiverQualifier
      {
        set { _activityItemHashtable.Add(ISA07_ReceiverQualifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ISA07_ReceiverQualifierBAMFieldName]; }
      }

      public const string ISA07_ReceiverQualifierBAMFieldName = "ISA07_ReceiverQualifier";
 
      public string ISA08_ReceiverID
      {
        set { _activityItemHashtable.Add(ISA08_ReceiverIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ISA08_ReceiverIDBAMFieldName]; }
      }

      public const string ISA08_ReceiverIDBAMFieldName = "ISA08_ReceiverID";
 
      public string ISA09_Date
      {
        set { _activityItemHashtable.Add(ISA09_DateBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ISA09_DateBAMFieldName]; }
      }

      public const string ISA09_DateBAMFieldName = "ISA09_Date";
 
      public string ISA10_Time
      {
        set { _activityItemHashtable.Add(ISA10_TimeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ISA10_TimeBAMFieldName]; }
      }

      public const string ISA10_TimeBAMFieldName = "ISA10_Time";
 
      public string ISA11_ControlStandardsID
      {
        set { _activityItemHashtable.Add(ISA11_ControlStandardsIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ISA11_ControlStandardsIDBAMFieldName]; }
      }

      public const string ISA11_ControlStandardsIDBAMFieldName = "ISA11_ControlStandardsID";
 
      public string ISA12_InterchangeControlVersionNumber
      {
        set { _activityItemHashtable.Add(ISA12_InterchangeControlVersionNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ISA12_InterchangeControlVersionNumberBAMFieldName]; }
      }

      public const string ISA12_InterchangeControlVersionNumberBAMFieldName = "ISA12_InterchangeControlVersionNumber";
 
      public string ISA13_InterchangeControlNumber
      {
        set { _activityItemHashtable.Add(ISA13_InterchangeControlNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ISA13_InterchangeControlNumberBAMFieldName]; }
      }

      public const string ISA13_InterchangeControlNumberBAMFieldName = "ISA13_InterchangeControlNumber";
 
      public string ISA14_AcknowledgementRequested
      {
        set { _activityItemHashtable.Add(ISA14_AcknowledgementRequestedBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ISA14_AcknowledgementRequestedBAMFieldName]; }
      }

      public const string ISA14_AcknowledgementRequestedBAMFieldName = "ISA14_AcknowledgementRequested";
 
      public string ISA15_TestIndicator
      {
        set { _activityItemHashtable.Add(ISA15_TestIndicatorBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ISA15_TestIndicatorBAMFieldName]; }
      }

      public const string ISA15_TestIndicatorBAMFieldName = "ISA15_TestIndicator";
 
      public string ISA16_SubelementSeparator
      {
        set { _activityItemHashtable.Add(ISA16_SubelementSeparatorBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ISA16_SubelementSeparatorBAMFieldName]; }
      }

      public const string ISA16_SubelementSeparatorBAMFieldName = "ISA16_SubelementSeparator";
 
      public string DataElementSeparator
      {
        set { _activityItemHashtable.Add(DataElementSeparatorBAMFieldName,value); }
        get { return (string)_activityItemHashtable[DataElementSeparatorBAMFieldName]; }
      }

      public const string DataElementSeparatorBAMFieldName = "DataElementSeparator";
 
      public string SegmentTerminator
      {
        set { _activityItemHashtable.Add(SegmentTerminatorBAMFieldName,value); }
        get { return (string)_activityItemHashtable[SegmentTerminatorBAMFieldName]; }
      }

      public const string SegmentTerminatorBAMFieldName = "SegmentTerminator";
 
      public const string ActivityName = "EDI_Envelope_Interchange";
      private string _EDI_Envelope_InterchangeID = null;
      private Hashtable _activityItemHashtable = new Hashtable();
    }
  
  #endregion

    #region Helper class for the EDI_Envelope_Group BAM activity
  
    public class EDI_Envelope_Group
    {
      public EDI_Envelope_Group(string EDI_Envelope_GroupID)
      {
        _EDI_Envelope_GroupID = EDI_Envelope_GroupID;
      } 

      public string ActivityID
      {
        get { return _EDI_Envelope_GroupID; }
      }	

      // Begin the EDI_Envelope_Group BAM activity
      public void BeginEDI_Envelope_GroupActivity()
      {			
        // Begin the Activity using the passed identifier
        BufferedEventStream es = GetEventStream();
        es.BeginActivity(ActivityName ,_EDI_Envelope_GroupID);
        
      }

      // Write any data changes to the _EDI_Envelope_Group activity
      // This must be called post any property changes
      public void CommitEDI_Envelope_GroupActivity()
      {
        // We need to provide the key/value pairs to the BAM API
        ArrayList al = new ArrayList();								
        foreach (DictionaryEntry de in _activityItemHashtable)
        {
          al.Add(de.Key);
          al.Add(de.Value);
        }
        			
        // Update the BAM Activity with all of the data
        BufferedEventStream es = GetEventStream();
        es.UpdateActivity(ActivityName,_EDI_Envelope_GroupID,al.ToArray() );	
              
      }

      // End the EDI_Envelope_Group BAM activity, no more changes will be permitted to this activity unless continuation is used
      public void EndEDI_Envelope_GroupActivity()
      {
        // End this activity, no more data can be added.
        BufferedEventStream es = GetEventStream();
        es.EndActivity(ActivityName,_EDI_Envelope_GroupID);
      }

      // Add a reference from this activity to another activity
      public void AddReferenceToAnotherActivity(string OtherActivityName, string OtherActivityID)
      {
        // Add a reference to another activity
        BufferedEventStream es = GetEventStream();
        es.AddReference(ActivityName,_EDI_Envelope_GroupID,"Activity",OtherActivityName,OtherActivityID);
      }

      // Add a custom reference to this activity, this enables "data" to be attached to an activity such as a message body
      public void AddCustomReference(string referenceName, string referenceType, string referenceData, string longReferenceData)
      { 
        // Add a reference to another activity
        BufferedEventStream es = GetEventStream();
        es.AddReference(ActivityName,_EDI_Envelope_GroupID,referenceName,referenceType,referenceData, longReferenceData);
      }

      
      public string GS01_FunctionalIDCode
      {
        set { _activityItemHashtable.Add(GS01_FunctionalIDCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[GS01_FunctionalIDCodeBAMFieldName]; }
      }

      public const string GS01_FunctionalIDCodeBAMFieldName = "GS01_FunctionalIDCode";
 
      public string GS02_ApplicationSenderCode
      {
        set { _activityItemHashtable.Add(GS02_ApplicationSenderCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[GS02_ApplicationSenderCodeBAMFieldName]; }
      }

      public const string GS02_ApplicationSenderCodeBAMFieldName = "GS02_ApplicationSenderCode";
 
      public string BTSMessageID
      {
        set { _activityItemHashtable.Add(BTSMessageIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSMessageIDBAMFieldName]; }
      }

      public const string BTSMessageIDBAMFieldName = "BTSMessageID";
 
      public string BTSInterchangeID
      {
        set { _activityItemHashtable.Add(BTSInterchangeIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSInterchangeIDBAMFieldName]; }
      }

      public const string BTSInterchangeIDBAMFieldName = "BTSInterchangeID";
 
      public string GS03_ApplicationReceiverCode
      {
        set { _activityItemHashtable.Add(GS03_ApplicationReceiverCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[GS03_ApplicationReceiverCodeBAMFieldName]; }
      }

      public const string GS03_ApplicationReceiverCodeBAMFieldName = "GS03_ApplicationReceiverCode";
 
      public string GS04_Date
      {
        set { _activityItemHashtable.Add(GS04_DateBAMFieldName,value); }
        get { return (string)_activityItemHashtable[GS04_DateBAMFieldName]; }
      }

      public const string GS04_DateBAMFieldName = "GS04_Date";
 
      public string GS05_Time
      {
        set { _activityItemHashtable.Add(GS05_TimeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[GS05_TimeBAMFieldName]; }
      }

      public const string GS05_TimeBAMFieldName = "GS05_Time";
 
      public string GS06_GroupControlNumber
      {
        set { _activityItemHashtable.Add(GS06_GroupControlNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[GS06_GroupControlNumberBAMFieldName]; }
      }

      public const string GS06_GroupControlNumberBAMFieldName = "GS06_GroupControlNumber";
 
      public string GS07_ResponsibleAgencyCode
      {
        set { _activityItemHashtable.Add(GS07_ResponsibleAgencyCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[GS07_ResponsibleAgencyCodeBAMFieldName]; }
      }

      public const string GS07_ResponsibleAgencyCodeBAMFieldName = "GS07_ResponsibleAgencyCode";
 
      public string GS08_VersionIDCode
      {
        set { _activityItemHashtable.Add(GS08_VersionIDCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[GS08_VersionIDCodeBAMFieldName]; }
      }

      public const string GS08_VersionIDCodeBAMFieldName = "GS08_VersionIDCode";
 
      public const string ActivityName = "EDI_Envelope_Group";
      private string _EDI_Envelope_GroupID = null;
      private Hashtable _activityItemHashtable = new Hashtable();
    }
  
  #endregion

    #region Helper class for the EDI_Envelope_Transaction BAM activity
  
    public class EDI_Envelope_Transaction
    {
      public EDI_Envelope_Transaction(string EDI_Envelope_TransactionID)
      {
        _EDI_Envelope_TransactionID = EDI_Envelope_TransactionID;
      } 

      public string ActivityID
      {
        get { return _EDI_Envelope_TransactionID; }
      }	

      // Begin the EDI_Envelope_Transaction BAM activity
      public void BeginEDI_Envelope_TransactionActivity()
      {			
        // Begin the Activity using the passed identifier
        BufferedEventStream es = GetEventStream();
        es.BeginActivity(ActivityName ,_EDI_Envelope_TransactionID);
        
      }

      // Write any data changes to the _EDI_Envelope_Transaction activity
      // This must be called post any property changes
      public void CommitEDI_Envelope_TransactionActivity()
      {
        // We need to provide the key/value pairs to the BAM API
        ArrayList al = new ArrayList();								
        foreach (DictionaryEntry de in _activityItemHashtable)
        {
          al.Add(de.Key);
          al.Add(de.Value);
        }
        			
        // Update the BAM Activity with all of the data
        BufferedEventStream es = GetEventStream();
        es.UpdateActivity(ActivityName,_EDI_Envelope_TransactionID,al.ToArray() );	
              
      }

      // End the EDI_Envelope_Transaction BAM activity, no more changes will be permitted to this activity unless continuation is used
      public void EndEDI_Envelope_TransactionActivity()
      {
        // End this activity, no more data can be added.
        BufferedEventStream es = GetEventStream();
        es.EndActivity(ActivityName,_EDI_Envelope_TransactionID);
      }

      // Add a reference from this activity to another activity
      public void AddReferenceToAnotherActivity(string OtherActivityName, string OtherActivityID)
      {
        // Add a reference to another activity
        BufferedEventStream es = GetEventStream();
        es.AddReference(ActivityName,_EDI_Envelope_TransactionID,"Activity",OtherActivityName,OtherActivityID);
      }

      // Add a custom reference to this activity, this enables "data" to be attached to an activity such as a message body
      public void AddCustomReference(string referenceName, string referenceType, string referenceData, string longReferenceData)
      { 
        // Add a reference to another activity
        BufferedEventStream es = GetEventStream();
        es.AddReference(ActivityName,_EDI_Envelope_TransactionID,referenceName,referenceType,referenceData, longReferenceData);
      }

      
      public string ST01_TransactionSetIDCode
      {
        set { _activityItemHashtable.Add(ST01_TransactionSetIDCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ST01_TransactionSetIDCodeBAMFieldName]; }
      }

      public const string ST01_TransactionSetIDCodeBAMFieldName = "ST01_TransactionSetIDCode";
 
      public string ST02_TransactionSetControlNumber
      {
        set { _activityItemHashtable.Add(ST02_TransactionSetControlNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ST02_TransactionSetControlNumberBAMFieldName]; }
      }

      public const string ST02_TransactionSetControlNumberBAMFieldName = "ST02_TransactionSetControlNumber";
 
      public string BTSMessageID
      {
        set { _activityItemHashtable.Add(BTSMessageIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSMessageIDBAMFieldName]; }
      }

      public const string BTSMessageIDBAMFieldName = "BTSMessageID";
 
      public string BTSInterchangeID
      {
        set { _activityItemHashtable.Add(BTSInterchangeIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSInterchangeIDBAMFieldName]; }
      }

      public const string BTSInterchangeIDBAMFieldName = "BTSInterchangeID";
 
      public const string ActivityName = "EDI_Envelope_Transaction";
      private string _EDI_Envelope_TransactionID = null;
      private Hashtable _activityItemHashtable = new Hashtable();
    }
  
  #endregion

    #region Helper class for the MessageLog BAM activity
  
    public class MessageLog
    {
      public MessageLog(string MessageLogID)
      {
        _MessageLogID = MessageLogID;
      } 

      public string ActivityID
      {
        get { return _MessageLogID; }
      }	

      // Begin the MessageLog BAM activity
      public void BeginMessageLogActivity()
      {			
        // Begin the Activity using the passed identifier
        BufferedEventStream es = GetEventStream();
        es.BeginActivity(ActivityName ,_MessageLogID);
        
      }

      // Write any data changes to the _MessageLog activity
      // This must be called post any property changes
      public void CommitMessageLogActivity()
      {
        // We need to provide the key/value pairs to the BAM API
        ArrayList al = new ArrayList();								
        foreach (DictionaryEntry de in _activityItemHashtable)
        {
          al.Add(de.Key);
          al.Add(de.Value);
        }
        			
        // Update the BAM Activity with all of the data
        BufferedEventStream es = GetEventStream();
        es.UpdateActivity(ActivityName,_MessageLogID,al.ToArray() );	
              
      }

      // End the MessageLog BAM activity, no more changes will be permitted to this activity unless continuation is used
      public void EndMessageLogActivity()
      {
        // End this activity, no more data can be added.
        BufferedEventStream es = GetEventStream();
        es.EndActivity(ActivityName,_MessageLogID);
      }

      // Add a reference from this activity to another activity
      public void AddReferenceToAnotherActivity(string OtherActivityName, string OtherActivityID)
      {
        // Add a reference to another activity
        BufferedEventStream es = GetEventStream();
        es.AddReference(ActivityName,_MessageLogID,"Activity",OtherActivityName,OtherActivityID);
      }

      // Add a custom reference to this activity, this enables "data" to be attached to an activity such as a message body
      public void AddCustomReference(string referenceName, string referenceType, string referenceData, string longReferenceData)
      { 
        // Add a reference to another activity
        BufferedEventStream es = GetEventStream();
        es.AddReference(ActivityName,_MessageLogID,referenceName,referenceType,referenceData, longReferenceData);
      }

      
      public string BTSMessageID
      {
        set { _activityItemHashtable.Add(BTSMessageIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSMessageIDBAMFieldName]; }
      }

      public const string BTSMessageIDBAMFieldName = "BTSMessageID";
 
      public string BTSInterchangeID
      {
        set { _activityItemHashtable.Add(BTSInterchangeIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSInterchangeIDBAMFieldName]; }
      }

      public const string BTSInterchangeIDBAMFieldName = "BTSInterchangeID";
 
      public string CurrentStep
      {
        set { _activityItemHashtable.Add(CurrentStepBAMFieldName,value); }
        get { return (string)_activityItemHashtable[CurrentStepBAMFieldName]; }
      }

      public const string CurrentStepBAMFieldName = "CurrentStep";
 
      public string CurrentStepDetails
      {
        set { _activityItemHashtable.Add(CurrentStepDetailsBAMFieldName,value); }
        get { return (string)_activityItemHashtable[CurrentStepDetailsBAMFieldName]; }
      }

      public const string CurrentStepDetailsBAMFieldName = "CurrentStepDetails";
 
      public string NextStep
      {
        set { _activityItemHashtable.Add(NextStepBAMFieldName,value); }
        get { return (string)_activityItemHashtable[NextStepBAMFieldName]; }
      }

      public const string NextStepBAMFieldName = "NextStep";
 
      public const string ActivityName = "MessageLog";
      private string _MessageLogID = null;
      private Hashtable _activityItemHashtable = new Hashtable();
    }
  
  #endregion

    #region Helper class for the MessageContextProperties BAM activity
  
    public class MessageContextProperties
    {
      public MessageContextProperties(string MessageContextPropertiesID)
      {
        _MessageContextPropertiesID = MessageContextPropertiesID;
      } 

      public string ActivityID
      {
        get { return _MessageContextPropertiesID; }
      }	

      // Begin the MessageContextProperties BAM activity
      public void BeginMessageContextPropertiesActivity()
      {			
        // Begin the Activity using the passed identifier
        BufferedEventStream es = GetEventStream();
        es.BeginActivity(ActivityName ,_MessageContextPropertiesID);
        
      }

      // Write any data changes to the _MessageContextProperties activity
      // This must be called post any property changes
      public void CommitMessageContextPropertiesActivity()
      {
        // We need to provide the key/value pairs to the BAM API
        ArrayList al = new ArrayList();								
        foreach (DictionaryEntry de in _activityItemHashtable)
        {
          al.Add(de.Key);
          al.Add(de.Value);
        }
        			
        // Update the BAM Activity with all of the data
        BufferedEventStream es = GetEventStream();
        es.UpdateActivity(ActivityName,_MessageContextPropertiesID,al.ToArray() );	
              
      }

      // End the MessageContextProperties BAM activity, no more changes will be permitted to this activity unless continuation is used
      public void EndMessageContextPropertiesActivity()
      {
        // End this activity, no more data can be added.
        BufferedEventStream es = GetEventStream();
        es.EndActivity(ActivityName,_MessageContextPropertiesID);
      }

      // Add a reference from this activity to another activity
      public void AddReferenceToAnotherActivity(string OtherActivityName, string OtherActivityID)
      {
        // Add a reference to another activity
        BufferedEventStream es = GetEventStream();
        es.AddReference(ActivityName,_MessageContextPropertiesID,"Activity",OtherActivityName,OtherActivityID);
      }

      // Add a custom reference to this activity, this enables "data" to be attached to an activity such as a message body
      public void AddCustomReference(string referenceName, string referenceType, string referenceData, string longReferenceData)
      { 
        // Add a reference to another activity
        BufferedEventStream es = GetEventStream();
        es.AddReference(ActivityName,_MessageContextPropertiesID,referenceName,referenceType,referenceData, longReferenceData);
      }

      
      public string BTSMessageID
      {
        set { _activityItemHashtable.Add(BTSMessageIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSMessageIDBAMFieldName]; }
      }

      public const string BTSMessageIDBAMFieldName = "BTSMessageID";
 
      public string BTSInterchangeID
      {
        set { _activityItemHashtable.Add(BTSInterchangeIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSInterchangeIDBAMFieldName]; }
      }

      public const string BTSInterchangeIDBAMFieldName = "BTSInterchangeID";
 
      public string ContextName
      {
        set { _activityItemHashtable.Add(ContextNameBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ContextNameBAMFieldName]; }
      }

      public const string ContextNameBAMFieldName = "ContextName";
 
      public string ContextValue
      {
        set { _activityItemHashtable.Add(ContextValueBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ContextValueBAMFieldName]; }
      }

      public const string ContextValueBAMFieldName = "ContextValue";
 
      public const string ActivityName = "MessageContextProperties";
      private string _MessageContextPropertiesID = null;
      private Hashtable _activityItemHashtable = new Hashtable();
    }
  
  #endregion
			
    // Return the EventStream in use
    public static BufferedEventStream GetEventStream()
    {		
      return new BufferedEventStream("Integrated Security=SSPI;Data Source=.;Initial Catalog=BizTalkMsgBoxDb",1);
    }
    
  }
}
